; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (ConvexHullShape)

; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::PolyhedronSubmergedVolumeCalculator" = type { ptr, i8, i8, i32, float, %"class.JPH::Vec3" }
%"class.JPH::ConvexHullShape" = type <{ %"class.JPH::ConvexShape.base", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::AABox", %"class.JPH::Array.8", %"class.JPH::Array.11", %"class.JPH::Array.14", %"class.JPH::Array.17", float, float, float, [4 x i8] }>
%"class.JPH::ConvexShape.base" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::RefConst", float }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.5", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.5" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Array.8" = type { i64, i64, ptr }
%"class.JPH::Array.11" = type { i64, i64, ptr }
%"class.JPH::Array.14" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"struct.JPH::ConvexHullShape::Point" = type { %"class.JPH::Vec3", i32, [3 x i32] }
%"struct.JPH::ConvexHullShape::Face" = type { i16, i16 }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double, double) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH15ConvexHullShape18GetSubmergedVolumeERKNS_5Mat44ENS_4Vec3ERKNS_5PlaneERfS8_RS4_(ptr noundef nonnull align 16 dereferenceable(272) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 16 dereferenceable(16) %7) unnamed_addr #5 align 2 {
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca i8, align 1
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %"class.JPH::PolyhedronSubmergedVolumeCalculator", align 16
  %22 = alloca %"class.JPH::Mat44", align 16
  %23 = alloca %"class.JPH::Mat44", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca i8, align 1
  %36 = alloca ptr, align 8
  %37 = alloca i32, align 4
  %38 = alloca ptr, align 8
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca ptr, align 8
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  store double %2, ptr %44, align 16
  %45 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  store double %3, ptr %45, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  store ptr %7, ptr %15, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #9
  %47 = call { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16) %9)
  %48 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %49 = getelementptr inbounds %union.anon.6, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 0
  %51 = extractvalue { double, double } %47, 0
  store double %51, ptr %50, align 16
  %52 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 1
  %53 = extractvalue { double, double } %47, 1
  store double %53, ptr %52, align 8
  %54 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %46, i32 0, i32 10
  %55 = load float, ptr %54, align 4, !tbaa !9
  %56 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %16)
  %57 = fmul float %55, %56
  %58 = call noundef float @_ZNK3JPH4Vec34GetYEv(ptr noundef nonnull align 16 dereferenceable(16) %16)
  %59 = fmul float %57, %58
  %60 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %16)
  %61 = fmul float %59, %60
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  store float %61, ptr %62, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !30
  %63 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %64 = load double, ptr %63, align 16
  %65 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %66 = load double, ptr %65, align 8
  %67 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double %64, double %66)
  %68 = zext i1 %67 to i8
  store i8 %68, ptr %17, align 1, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %69 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %46, i32 0, i32 5
  %70 = call noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %19, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %72 = load i32, ptr %19, align 4, !tbaa !34
  %73 = sext i32 %72 to i64
  %74 = mul i64 %73, 32
  %75 = alloca i8, i64 %74, align 16
  store ptr %75, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #9
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %23) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !30
  %77 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %78 = load double, ptr %77, align 16
  %79 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %80 = load double, ptr %79, align 8
  call void @_ZN3JPH5Mat446sScaleENS_4Vec3E(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %23, double %78, double %80)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %22, ptr noundef nonnull align 16 dereferenceable(64) %76, ptr noundef nonnull align 16 dereferenceable(64) %23)
  %81 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %46, i32 0, i32 5
  %82 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef 0)
  %83 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %82, i32 0, i32 0
  %84 = load i32, ptr %19, align 4, !tbaa !34
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculatorC2ERKNS_5Mat44EPKNS_4Vec3EiiRKNS_5PlaneEPNS0_5PointE(ptr noundef nonnull align 16 dereferenceable(48) %21, ptr noundef nonnull align 16 dereferenceable(64) %22, ptr noundef %83, i32 noundef 32, i32 noundef %84, ptr noundef nonnull align 16 dereferenceable(16) %85, ptr noundef %86)
  call void @llvm.lifetime.end.p0(i64 64, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #9
  %87 = call noundef zeroext i1 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator11AreAllAboveEv(ptr noundef nonnull align 16 dereferenceable(48) %21)
  br i1 %87, label %88, label %98

88:                                               ; preds = %8
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  store float 0.000000e+00, ptr %89, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #9
  %90 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %91 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon.6, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 0
  %94 = extractvalue { double, double } %90, 0
  store double %94, ptr %93, align 16
  %95 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 1
  %96 = extractvalue { double, double } %90, 1
  store double %96, ptr %95, align 8
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %97, ptr align 16 %25, i64 16, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #9
  br label %230

98:                                               ; preds = %8
  %99 = call noundef zeroext i1 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator11AreAllBelowEv(ptr noundef nonnull align 16 dereferenceable(48) %21)
  br i1 %99, label %100, label %113

100:                                              ; preds = %98
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = load float, ptr %101, align 4, !tbaa !29
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  store float %102, ptr %103, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #9
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %104)
  %106 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %107 = getelementptr inbounds %union.anon.6, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds { double, double }, ptr %107, i32 0, i32 0
  %109 = extractvalue { double, double } %105, 0
  store double %109, ptr %108, align 16
  %110 = getelementptr inbounds { double, double }, ptr %107, i32 0, i32 1
  %111 = extractvalue { double, double } %105, 1
  store double %111, ptr %110, align 8
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %112, ptr align 16 %26, i64 16, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #9
  br label %229

113:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %114 = call noundef i32 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator20GetReferencePointIdxEv(ptr noundef nonnull align 16 dereferenceable(48) %21)
  store i32 %114, ptr %27, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %115 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %46, i32 0, i32 6
  store ptr %115, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %116 = load ptr, ptr %28, align 8, !tbaa !5
  %117 = call noundef ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %116)
  store ptr %117, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %118 = load ptr, ptr %28, align 8, !tbaa !5
  %119 = call noundef ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %118)
  store ptr %119, ptr %30, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %223, %113
  %121 = load ptr, ptr %29, align 8, !tbaa !5
  %122 = load ptr, ptr %30, align 8, !tbaa !5
  %123 = icmp ne ptr %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 2, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %226

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %126 = load ptr, ptr %29, align 8, !tbaa !5
  store ptr %126, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  %127 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %46, i32 0, i32 8
  %128 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %127)
  %129 = load ptr, ptr %32, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %129, i32 0, i32 0
  %131 = load i16, ptr %130, align 2, !tbaa !35
  %132 = zext i16 %131 to i32
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i8, ptr %128, i64 %133
  store ptr %134, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %135 = load ptr, ptr %33, align 8, !tbaa !5
  %136 = load ptr, ptr %32, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %136, i32 0, i32 1
  %138 = load i16, ptr %137, align 2, !tbaa !38
  %139 = zext i16 %138 to i32
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i8, ptr %135, i64 %140
  store ptr %141, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %35) #9
  store i8 0, ptr %35, align 1, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #9
  %142 = load ptr, ptr %33, align 8, !tbaa !5
  store ptr %142, ptr %36, align 8, !tbaa !5
  br label %143

143:                                              ; preds = %156, %125
  %144 = load ptr, ptr %36, align 8, !tbaa !5
  %145 = load ptr, ptr %34, align 8, !tbaa !5
  %146 = icmp ult ptr %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 4, ptr %31, align 4
  br label %159

148:                                              ; preds = %143
  %149 = load ptr, ptr %36, align 8, !tbaa !5
  %150 = load i8, ptr %149, align 1, !tbaa !31
  %151 = zext i8 %150 to i32
  %152 = load i32, ptr %27, align 4, !tbaa !34
  %153 = icmp eq i32 %151, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %148
  store i8 1, ptr %35, align 1, !tbaa !32
  store i32 4, ptr %31, align 4
  br label %159

155:                                              ; preds = %148
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %36, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i32 1
  store ptr %158, ptr %36, align 8, !tbaa !5
  br label %143, !llvm.loop !39

159:                                              ; preds = %154, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  br label %160

160:                                              ; preds = %159
  %161 = load i8, ptr %35, align 1, !tbaa !32, !range !41, !noundef !42
  %162 = trunc i8 %161 to i1
  br i1 %162, label %163, label %164

163:                                              ; preds = %160
  store i32 3, ptr %31, align 4
  br label %217

164:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  %165 = load ptr, ptr %33, align 8, !tbaa !5
  %166 = load i8, ptr %165, align 1, !tbaa !31
  %167 = zext i8 %166 to i32
  store i32 %167, ptr %37, align 4, !tbaa !34
  %168 = load i8, ptr %17, align 1, !tbaa !32, !range !41, !noundef !42
  %169 = trunc i8 %168 to i1
  br i1 %169, label %170, label %193

170:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  %171 = load ptr, ptr %33, align 8, !tbaa !5
  %172 = getelementptr inbounds i8, ptr %171, i64 2
  store ptr %172, ptr %38, align 8, !tbaa !5
  br label %173

173:                                              ; preds = %189, %170
  %174 = load ptr, ptr %38, align 8, !tbaa !5
  %175 = load ptr, ptr %34, align 8, !tbaa !5
  %176 = icmp ult ptr %174, %175
  br i1 %176, label %178, label %177

177:                                              ; preds = %173
  store i32 7, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  br label %192

178:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  %179 = load ptr, ptr %38, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 -1
  %181 = load i8, ptr %180, align 1, !tbaa !31
  %182 = zext i8 %181 to i32
  store i32 %182, ptr %39, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  %183 = load ptr, ptr %38, align 8, !tbaa !5
  %184 = load i8, ptr %183, align 1, !tbaa !31
  %185 = zext i8 %184 to i32
  store i32 %185, ptr %40, align 4, !tbaa !34
  %186 = load i32, ptr %37, align 4, !tbaa !34
  %187 = load i32, ptr %40, align 4, !tbaa !34
  %188 = load i32, ptr %39, align 4, !tbaa !34
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48) %21, i32 noundef %186, i32 noundef %187, i32 noundef %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %189

189:                                              ; preds = %178
  %190 = load ptr, ptr %38, align 8, !tbaa !5
  %191 = getelementptr inbounds i8, ptr %190, i32 1
  store ptr %191, ptr %38, align 8, !tbaa !5
  br label %173, !llvm.loop !43

192:                                              ; preds = %177
  br label %216

193:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #9
  %194 = load ptr, ptr %33, align 8, !tbaa !5
  %195 = getelementptr inbounds i8, ptr %194, i64 2
  store ptr %195, ptr %41, align 8, !tbaa !5
  br label %196

196:                                              ; preds = %212, %193
  %197 = load ptr, ptr %41, align 8, !tbaa !5
  %198 = load ptr, ptr %34, align 8, !tbaa !5
  %199 = icmp ult ptr %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 10, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #9
  br label %215

201:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  %202 = load ptr, ptr %41, align 8, !tbaa !5
  %203 = getelementptr inbounds i8, ptr %202, i64 -1
  %204 = load i8, ptr %203, align 1, !tbaa !31
  %205 = zext i8 %204 to i32
  store i32 %205, ptr %42, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  %206 = load ptr, ptr %41, align 8, !tbaa !5
  %207 = load i8, ptr %206, align 1, !tbaa !31
  %208 = zext i8 %207 to i32
  store i32 %208, ptr %43, align 4, !tbaa !34
  %209 = load i32, ptr %37, align 4, !tbaa !34
  %210 = load i32, ptr %42, align 4, !tbaa !34
  %211 = load i32, ptr %43, align 4, !tbaa !34
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48) %21, i32 noundef %209, i32 noundef %210, i32 noundef %211)
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %212

212:                                              ; preds = %201
  %213 = load ptr, ptr %41, align 8, !tbaa !5
  %214 = getelementptr inbounds i8, ptr %213, i32 1
  store ptr %214, ptr %41, align 8, !tbaa !5
  br label %196, !llvm.loop !44

215:                                              ; preds = %200
  br label %216

216:                                              ; preds = %215, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  store i32 0, ptr %31, align 4
  br label %217

217:                                              ; preds = %216, %163
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  %218 = load i32, ptr %31, align 4
  switch i32 %218, label %220 [
    i32 0, label %219
  ]

219:                                              ; preds = %217
  store i32 0, ptr %31, align 4
  br label %220

220:                                              ; preds = %219, %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  %221 = load i32, ptr %31, align 4
  switch i32 %221, label %231 [
    i32 0, label %222
    i32 3, label %223
  ]

222:                                              ; preds = %220
  br label %223

223:                                              ; preds = %222, %220
  %224 = load ptr, ptr %29, align 8, !tbaa !5
  %225 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %224, i32 1
  store ptr %225, ptr %29, align 8, !tbaa !5
  br label %120

226:                                              ; preds = %124
  %227 = load ptr, ptr %14, align 8, !tbaa !5
  %228 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator9GetResultERfRNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(48) %21, ptr noundef nonnull align 4 dereferenceable(4) %227, ptr noundef nonnull align 16 dereferenceable(16) %228)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %229

229:                                              ; preds = %226, %100
  br label %230

230:                                              ; preds = %229, %88
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #9
  ret void

231:                                              ; preds = %220
  unreachable
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16)) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16)) #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetYEv(ptr noundef nonnull align 16 dereferenceable(16)) #7 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16)) #7 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat446sScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double) #8 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH35PolyhedronSubmergedVolumeCalculatorC2ERKNS_5Mat44EPKNS_4Vec3EiiRKNS_5PlaneEPNS0_5PointE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) unnamed_addr #5 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() #2 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64)) #8 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator9GetResultERfRNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 16 dereferenceable(16)) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #7 = { 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 #8 = { alwaysinline 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 #9 = { 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, !21, i64 260}
!10 = !{!"_ZTSN3JPH15ConvexHullShapeE", !11, i64 0, !22, i64 48, !23, i64 64, !24, i64 128, !25, i64 160, !26, i64 184, !27, i64 208, !28, i64 232, !21, i64 256, !21, i64 260, !21, i64 264}
!11 = !{!"_ZTSN3JPH11ConvexShapeE", !12, i64 0, !20, i64 32, !21, i64 40}
!12 = !{!"_ZTSN3JPH5ShapeE", !13, i64 8, !17, i64 16, !18, i64 24, !19, i64 25}
!13 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !14, i64 0}
!14 = !{!"_ZTSSt6atomicIjE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIjE", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!20 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !6, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!23 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!24 = !{!"_ZTSN3JPH5AABoxE", !22, i64 0, !22, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!26 = !{!"_ZTSN3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayINS_5PlaneENS_12STLAllocatorIS1_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!29 = !{!21, !21, i64 0}
!30 = !{i64 0, i64 16, !31}
!31 = !{!7, !7, i64 0}
!32 = !{!33, !33, i64 0}
!33 = !{!"bool", !7, i64 0}
!34 = !{!16, !16, i64 0}
!35 = !{!36, !37, i64 0}
!36 = !{!"_ZTSN3JPH15ConvexHullShape4FaceE", !37, i64 0, !37, i64 2}
!37 = !{!"short", !7, i64 0}
!38 = !{!36, !37, i64 2}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{i8 0, i8 2}
!42 = !{}
!43 = distinct !{!43, !40}
!44 = distinct !{!44, !40}


; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::PolyhedronSubmergedVolumeCalculator" = type { ptr, i8, i8, i32, float, %"class.JPH::Vec3" }

; 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: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH15ConvexHullShape18GetSubmergedVolumeERKNS_5Mat44ENS_4Vec3ERKNS_5PlaneERfS8_RS4_(ptr noundef nonnull align 16 dereferenceable(272) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr nocapture noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 16 dereferenceable(16) %7) unnamed_addr #4 align 2 {
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::PolyhedronSubmergedVolumeCalculator", align 16
  %12 = alloca %"class.JPH::Mat44", align 16
  %13 = alloca %"class.JPH::Mat44", align 16
  store double %2, ptr %9, align 16
  %14 = getelementptr inbounds i8, ptr %9, i64 8
  store double %3, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %15 = call { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16) %9)
  %16 = extractvalue { double, double } %15, 0
  store double %16, ptr %10, align 16
  %17 = getelementptr inbounds i8, ptr %10, i64 8
  %18 = extractvalue { double, double } %15, 1
  store double %18, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr %0, i64 260
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %22 = fmul float %20, %21
  %23 = call noundef float @_ZNK3JPH4Vec34GetYEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %24 = fmul float %22, %23
  %25 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %26 = fmul float %24, %25
  store float %26, ptr %5, align 4, !tbaa !28
  %.sroa.041.0.copyload = load double, ptr %9, align 16
  %.sroa.242.0.copyload = load double, ptr %14, align 8, !tbaa !29
  %27 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double %.sroa.041.0.copyload, double %.sroa.242.0.copyload)
  %28 = getelementptr inbounds i8, ptr %0, i64 160
  %29 = call noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28)
  %30 = trunc i64 %29 to i32
  %sext = shl i64 %29, 32
  %31 = ashr exact i64 %sext, 27
  %32 = alloca i8, i64 %31, align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #8
  %.sroa.037.0.copyload = load double, ptr %9, align 16
  %.sroa.2.0.copyload = load double, ptr %14, align 8, !tbaa !29
  call void @_ZN3JPH5Mat446sScaleENS_4Vec3E(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %13, double %.sroa.037.0.copyload, double %.sroa.2.0.copyload)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %12, ptr noundef nonnull align 16 dereferenceable(64) %1, ptr noundef nonnull align 16 dereferenceable(64) %13)
  %33 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef 0)
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculatorC2ERKNS_5Mat44EPKNS_4Vec3EiiRKNS_5PlaneEPNS0_5PointE(ptr noundef nonnull align 16 dereferenceable(48) %11, ptr noundef nonnull align 16 dereferenceable(64) %12, ptr noundef nonnull %33, i32 noundef 32, i32 noundef %30, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull %32)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #8
  %34 = call noundef zeroext i1 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator11AreAllAboveEv(ptr noundef nonnull align 16 dereferenceable(48) %11)
  br i1 %34, label %35, label %39

35:                                               ; preds = %8
  store float 0.000000e+00, ptr %6, align 4, !tbaa !28
  %36 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  store double %37, ptr %7, align 16
  %.sroa.436.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store double %38, ptr %.sroa.436.0..sroa_idx, align 8, !tbaa !29
  br label %104

39:                                               ; preds = %8
  %40 = call noundef zeroext i1 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator11AreAllBelowEv(ptr noundef nonnull align 16 dereferenceable(48) %11)
  br i1 %40, label %41, label %46

41:                                               ; preds = %39
  %42 = load float, ptr %5, align 4, !tbaa !28
  store float %42, ptr %6, align 4, !tbaa !28
  %43 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %1)
  %44 = extractvalue { double, double } %43, 0
  %45 = extractvalue { double, double } %43, 1
  store double %44, ptr %7, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store double %45, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !29
  br label %104

46:                                               ; preds = %39
  %47 = call noundef i32 @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator20GetReferencePointIdxEv(ptr noundef nonnull align 16 dereferenceable(48) %11)
  %48 = getelementptr inbounds i8, ptr %0, i64 184
  %49 = call noundef ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  %50 = call noundef ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  %.not68 = icmp eq ptr %49, %50
  br i1 %.not68, label %._crit_edge, label %.lr.ph70

.lr.ph70:                                         ; preds = %46
  %51 = getelementptr inbounds i8, ptr %0, i64 232
  br i1 %27, label %.lr.ph70.split.us, label %.lr.ph70.split

.lr.ph70.split.us:                                ; preds = %.lr.ph70, %.loopexit.us
  %.069.us = phi ptr [ %77, %.loopexit.us ], [ %49, %.lr.ph70 ]
  %52 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %53 = load i16, ptr %.069.us, align 2, !tbaa !30
  %54 = zext i16 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = getelementptr inbounds i8, ptr %.069.us, i64 2
  %57 = load i16, ptr %56, align 2, !tbaa !33
  %58 = zext i16 %57 to i64
  %59 = getelementptr inbounds i8, ptr %55, i64 %58
  %.not72 = icmp eq i16 %57, 0
  br i1 %.not72, label %.loopexit.us, label %.lr.ph.us

60:                                               ; preds = %.lr.ph.us
  %61 = getelementptr inbounds i8, ptr %.05963.us, i64 1
  %62 = icmp ult ptr %61, %59
  br i1 %62, label %.lr.ph.us, label %.critedge.us, !llvm.loop !34

.critedge.us:                                     ; preds = %60
  %63 = load i8, ptr %55, align 1, !tbaa !29
  %64 = zext i8 %63 to i32
  %65 = icmp ugt i16 %57, 2
  br i1 %65, label %.lr.ph67.us.preheader, label %.loopexit.us

.lr.ph67.us.preheader:                            ; preds = %.critedge.us
  %66 = getelementptr inbounds i8, ptr %55, i64 2
  br label %.lr.ph67.us

.lr.ph67.us:                                      ; preds = %.lr.ph67.us.preheader, %.lr.ph67.us
  %.06066.us = phi ptr [ %72, %.lr.ph67.us ], [ %66, %.lr.ph67.us.preheader ]
  %67 = getelementptr inbounds i8, ptr %.06066.us, i64 -1
  %68 = load i8, ptr %67, align 1, !tbaa !29
  %69 = zext i8 %68 to i32
  %70 = load i8, ptr %.06066.us, align 1, !tbaa !29
  %71 = zext i8 %70 to i32
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48) %11, i32 noundef %64, i32 noundef %71, i32 noundef %69)
  %72 = getelementptr inbounds i8, ptr %.06066.us, i64 1
  %73 = icmp ult ptr %72, %59
  br i1 %73, label %.lr.ph67.us, label %.loopexit.us, !llvm.loop !36

.lr.ph.us:                                        ; preds = %.lr.ph70.split.us, %60
  %.05963.us = phi ptr [ %61, %60 ], [ %55, %.lr.ph70.split.us ]
  %74 = load i8, ptr %.05963.us, align 1, !tbaa !29
  %75 = zext i8 %74 to i32
  %76 = icmp eq i32 %47, %75
  br i1 %76, label %.loopexit.us, label %60

.loopexit.us:                                     ; preds = %.lr.ph.us, %.lr.ph67.us, %.lr.ph70.split.us, %.critedge.us
  %77 = getelementptr inbounds i8, ptr %.069.us, i64 4
  %.not.us = icmp eq ptr %77, %50
  br i1 %.not.us, label %._crit_edge, label %.lr.ph70.split.us

._crit_edge:                                      ; preds = %.loopexit61, %.loopexit.us, %46
  call void @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator9GetResultERfRNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(48) %11, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 16 dereferenceable(16) %7)
  br label %104

.lr.ph70.split:                                   ; preds = %.lr.ph70, %.loopexit61
  %.069 = phi ptr [ %103, %.loopexit61 ], [ %49, %.lr.ph70 ]
  %78 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %79 = load i16, ptr %.069, align 2, !tbaa !30
  %80 = zext i16 %79 to i64
  %81 = getelementptr inbounds i8, ptr %78, i64 %80
  %82 = getelementptr inbounds i8, ptr %.069, i64 2
  %83 = load i16, ptr %82, align 2, !tbaa !33
  %84 = zext i16 %83 to i64
  %85 = getelementptr inbounds i8, ptr %81, i64 %84
  %.not71 = icmp eq i16 %83, 0
  br i1 %.not71, label %.loopexit61, label %.lr.ph

86:                                               ; preds = %.lr.ph
  %87 = getelementptr inbounds i8, ptr %.05963, i64 1
  %88 = icmp ult ptr %87, %85
  br i1 %88, label %.lr.ph, label %.critedge, !llvm.loop !34

.lr.ph:                                           ; preds = %.lr.ph70.split, %86
  %.05963 = phi ptr [ %87, %86 ], [ %81, %.lr.ph70.split ]
  %89 = load i8, ptr %.05963, align 1, !tbaa !29
  %90 = zext i8 %89 to i32
  %91 = icmp eq i32 %47, %90
  br i1 %91, label %.loopexit61, label %86

.critedge:                                        ; preds = %86
  %92 = load i8, ptr %81, align 1, !tbaa !29
  %93 = zext i8 %92 to i32
  %94 = icmp ugt i16 %83, 2
  br i1 %94, label %.lr.ph65.preheader, label %.loopexit61

.lr.ph65.preheader:                               ; preds = %.critedge
  %95 = getelementptr inbounds i8, ptr %81, i64 2
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %.05764 = phi ptr [ %101, %.lr.ph65 ], [ %95, %.lr.ph65.preheader ]
  %96 = getelementptr inbounds i8, ptr %.05764, i64 -1
  %97 = load i8, ptr %96, align 1, !tbaa !29
  %98 = zext i8 %97 to i32
  %99 = load i8, ptr %.05764, align 1, !tbaa !29
  %100 = zext i8 %99 to i32
  call void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48) %11, i32 noundef %93, i32 noundef %98, i32 noundef %100)
  %101 = getelementptr inbounds i8, ptr %.05764, i64 1
  %102 = icmp ult ptr %101, %85
  br i1 %102, label %.lr.ph65, label %.loopexit61, !llvm.loop !37

.loopexit61:                                      ; preds = %.lr.ph, %.lr.ph65, %.lr.ph70.split, %.critedge
  %103 = getelementptr inbounds i8, ptr %.069, i64 4
  %.not = icmp eq ptr %103, %50
  br i1 %.not, label %._crit_edge, label %.lr.ph70.split

104:                                              ; preds = %41, %._crit_edge, %35
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec33AbsEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetYEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat446sScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH35PolyhedronSubmergedVolumeCalculatorC2ERKNS_5Mat44EPKNS_4Vec3EiiRKNS_5PlaneEPNS0_5PointE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(64), ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) unnamed_addr #4 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() local_unnamed_addr #1 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #7 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH35PolyhedronSubmergedVolumeCalculator7AddFaceEiii(ptr noundef nonnull align 16 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH35PolyhedronSubmergedVolumeCalculator9GetResultERfRNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #6 = { 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 #7 = { alwaysinline 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 #8 = { 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, !20, i64 260}
!6 = !{!"_ZTSN3JPH15ConvexHullShapeE", !7, i64 0, !21, i64 48, !22, i64 64, !23, i64 128, !24, i64 160, !25, i64 184, !26, i64 208, !27, i64 232, !20, i64 256, !20, i64 260, !20, i64 264}
!7 = !{!"_ZTSN3JPH11ConvexShapeE", !8, i64 0, !18, i64 32, !20, i64 40}
!8 = !{!"_ZTSN3JPH5ShapeE", !9, i64 8, !15, i64 16, !16, i64 24, !17, i64 25}
!9 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !10, i64 0}
!10 = !{!"_ZTSSt6atomicIjE", !11, i64 0}
!11 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"_ZTSN3JPH10EShapeTypeE", !13, i64 0}
!17 = !{!"_ZTSN3JPH13EShapeSubTypeE", !13, i64 0}
!18 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !19, i64 0}
!19 = !{!"any pointer", !13, i64 0}
!20 = !{!"float", !13, i64 0}
!21 = !{!"_ZTSN3JPH4Vec3E", !13, i64 0}
!22 = !{!"_ZTSN3JPH5Mat44E", !13, i64 0}
!23 = !{!"_ZTSN3JPH5AABoxE", !21, i64 0, !21, i64 16}
!24 = !{!"_ZTSN3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !19, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !19, i64 16}
!26 = !{!"_ZTSN3JPH5ArrayINS_5PlaneENS_12STLAllocatorIS1_EEEE", !15, i64 0, !15, i64 8, !19, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !15, i64 0, !15, i64 8, !19, i64 16}
!28 = !{!20, !20, i64 0}
!29 = !{!13, !13, i64 0}
!30 = !{!31, !32, i64 0}
!31 = !{!"_ZTSN3JPH15ConvexHullShape4FaceE", !32, i64 0, !32, i64 2}
!32 = !{!"short", !13, i64 0}
!33 = !{!31, !32, i64 2}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass