; LLVM IR from zig-gamedev/zphysics :: libs/Jolt/Physics/Collision (ManifoldBetweenTwoFaces)

; 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::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::StaticArray.2" = type { i32, [12 x i8], [32 x %"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage" = type { [16 x i8] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040)) #1 align 2

; 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040), ptr noundef nonnull align 16 dereferenceable(16)) #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #4

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH23ManifoldBetweenTwoFacesENS_4Vec3ES0_S0_fRKNS_11StaticArrayIS0_Lj32EEES4_RNS1_IS0_Lj64EEES6_(double %0, double %1, double %2, double %3, double %4, double %5, float noundef %6, ptr noundef nonnull align 16 dereferenceable(528) %7, ptr noundef nonnull align 16 dereferenceable(528) %8, ptr noundef nonnull align 16 dereferenceable(1040) %9, ptr noundef nonnull align 16 dereferenceable(1040) %10) #3 personality ptr @__gxx_personality_v0 {
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca float, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.JPH::StaticArray.2", align 16
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::Vec3", align 16
  %38 = alloca %"class.JPH::Vec3", align 16
  %39 = alloca float, align 4
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca %"class.JPH::Vec3", align 16
  %44 = alloca float, align 4
  %45 = alloca %"class.JPH::Vec3", align 16
  %46 = alloca %"class.JPH::Vec3", align 16
  %47 = alloca %"class.JPH::Vec3", align 16
  %48 = alloca %"class.JPH::Vec3", align 16
  %49 = alloca %"class.JPH::Vec3", align 16
  %50 = alloca %"class.JPH::Vec3", align 16
  %51 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  store double %0, ptr %51, align 16
  %52 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  store double %1, ptr %52, align 8
  %53 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  store double %2, ptr %53, align 16
  %54 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  store double %3, ptr %54, align 8
  %55 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  store double %4, ptr %55, align 16
  %56 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  store double %5, ptr %56, align 8
  store float %6, ptr %15, align 4, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !9
  store ptr %8, ptr %17, align 8, !tbaa !9
  store ptr %9, ptr %18, align 8, !tbaa !9
  store ptr %10, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %57 = load ptr, ptr %18, align 8, !tbaa !9
  %58 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040) %57)
  store i32 %58, ptr %20, align 4, !tbaa !11
  %59 = load ptr, ptr %16, align 8, !tbaa !9
  %60 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %59)
  %61 = icmp uge i32 %60, 2
  br i1 %61, label %62, label %318

62:                                               ; preds = %11
  %63 = load ptr, ptr %17, align 8, !tbaa !9
  %64 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %63)
  %65 = icmp uge i32 %64, 3
  br i1 %65, label %66, label %318

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 528, ptr %21) #6
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEC2Ev(ptr noundef nonnull align 16 dereferenceable(528) %21) #6
  %67 = load ptr, ptr %16, align 8, !tbaa !9
  %68 = invoke noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %67)
          to label %69 unwind label %79

69:                                               ; preds = %66
  %70 = icmp uge i32 %68, 3
  br i1 %70, label %71, label %83

71:                                               ; preds = %69
  %72 = load ptr, ptr %17, align 8, !tbaa !9
  %73 = load ptr, ptr %16, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !13
  %74 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %75 = load double, ptr %74, align 16
  %76 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %77 = load double, ptr %76, align 8
  invoke void @_ZN3JPH14ClipPolyVsPolyINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S6_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528) %72, ptr noundef nonnull align 16 dereferenceable(528) %73, double %75, double %77, ptr noundef nonnull align 16 dereferenceable(528) %21)
          to label %78 unwind label %79

78:                                               ; preds = %71
  br label %110

79:                                               ; preds = %95, %92, %88, %83, %71, %66
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %22, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %23, align 4
  br label %317

83:                                               ; preds = %69
  %84 = load ptr, ptr %16, align 8, !tbaa !9
  %85 = invoke noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %84)
          to label %86 unwind label %79

86:                                               ; preds = %83
  %87 = icmp eq i32 %85, 2
  br i1 %87, label %88, label %109

88:                                               ; preds = %86
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  %90 = load ptr, ptr %16, align 8, !tbaa !9
  %91 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %90, i32 noundef 0)
          to label %92 unwind label %79

92:                                               ; preds = %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %91, i64 16, i1 false), !tbaa.struct !13
  %93 = load ptr, ptr %16, align 8, !tbaa !9
  %94 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %93, i32 noundef 1)
          to label %95 unwind label %79

95:                                               ; preds = %92
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %94, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !13
  %96 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %97 = load double, ptr %96, align 16
  %98 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %99 = load double, ptr %98, align 8
  %100 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %101 = load double, ptr %100, align 16
  %102 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %103 = load double, ptr %102, align 8
  %104 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %105 = load double, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %107 = load double, ptr %106, align 8
  invoke void @_ZN3JPH14ClipPolyVsEdgeINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S2_S2_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528) %89, double %97, double %99, double %101, double %103, double %105, double %107, ptr noundef nonnull align 16 dereferenceable(528) %21)
          to label %108 unwind label %79

108:                                              ; preds = %95
  br label %109

109:                                              ; preds = %108, %86
  br label %110

110:                                              ; preds = %109, %78
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %111 = load ptr, ptr %16, align 8, !tbaa !9
  %112 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %111, i32 noundef 0)
          to label %113 unwind label %161

113:                                              ; preds = %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 %112, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %114 = load ptr, ptr %16, align 8, !tbaa !9
  %115 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %114, i32 noundef 1)
          to label %116 unwind label %165

116:                                              ; preds = %113
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !13
  %117 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %118 = load double, ptr %117, align 16
  %119 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %120 = load double, ptr %119, align 8
  %121 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %115, double %118, double %120)
          to label %122 unwind label %165

122:                                              ; preds = %116
  %123 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %124 = getelementptr inbounds %union.anon, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds { double, double }, ptr %124, i32 0, i32 0
  %126 = extractvalue { double, double } %121, 0
  store double %126, ptr %125, align 16
  %127 = getelementptr inbounds { double, double }, ptr %124, i32 0, i32 1
  %128 = extractvalue { double, double } %121, 1
  store double %128, ptr %127, align 8
  %129 = load ptr, ptr %16, align 8, !tbaa !9
  %130 = invoke noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %129)
          to label %131 unwind label %165

131:                                              ; preds = %122
  %132 = icmp uge i32 %130, 3
  br i1 %132, label %133, label %173

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  %134 = load ptr, ptr %16, align 8, !tbaa !9
  %135 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %134, i32 noundef 2)
          to label %136 unwind label %169

136:                                              ; preds = %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !13
  %137 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %138 = load double, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %140 = load double, ptr %139, align 8
  %141 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %135, double %138, double %140)
          to label %142 unwind label %169

142:                                              ; preds = %136
  %143 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i32 0, i32 0
  %144 = getelementptr inbounds %union.anon, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 0
  %146 = extractvalue { double, double } %141, 0
  store double %146, ptr %145, align 16
  %147 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 1
  %148 = extractvalue { double, double } %141, 1
  store double %148, ptr %147, align 8
  %149 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %150 = load double, ptr %149, align 16
  %151 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %152 = load double, ptr %151, align 8
  %153 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %30, double %150, double %152)
          to label %154 unwind label %169

154:                                              ; preds = %142
  %155 = getelementptr inbounds %"class.JPH::Vec3", ptr %32, i32 0, i32 0
  %156 = getelementptr inbounds %union.anon, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 0
  %158 = extractvalue { double, double } %153, 0
  store double %158, ptr %157, align 16
  %159 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 1
  %160 = extractvalue { double, double } %153, 1
  store double %160, ptr %159, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %32, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  br label %202

161:                                              ; preds = %110
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %22, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %23, align 4
  br label %316

165:                                              ; preds = %122, %116, %113
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %22, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %23, align 4
  br label %315

169:                                              ; preds = %142, %136, %133
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %22, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  br label %315

173:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %37, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !13
  %174 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %175 = load double, ptr %174, align 16
  %176 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %177 = load double, ptr %176, align 8
  %178 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %30, double %175, double %177)
          to label %179 unwind label %198

179:                                              ; preds = %173
  %180 = getelementptr inbounds %"class.JPH::Vec3", ptr %36, i32 0, i32 0
  %181 = getelementptr inbounds %union.anon, ptr %180, i32 0, i32 0
  %182 = getelementptr inbounds { double, double }, ptr %181, i32 0, i32 0
  %183 = extractvalue { double, double } %178, 0
  store double %183, ptr %182, align 16
  %184 = getelementptr inbounds { double, double }, ptr %181, i32 0, i32 1
  %185 = extractvalue { double, double } %178, 1
  store double %185, ptr %184, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 16 %30, i64 16, i1 false), !tbaa.struct !13
  %186 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %187 = load double, ptr %186, align 16
  %188 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %189 = load double, ptr %188, align 8
  %190 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %36, double %187, double %189)
          to label %191 unwind label %198

191:                                              ; preds = %179
  %192 = getelementptr inbounds %"class.JPH::Vec3", ptr %35, i32 0, i32 0
  %193 = getelementptr inbounds %union.anon, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds { double, double }, ptr %193, i32 0, i32 0
  %195 = extractvalue { double, double } %190, 0
  store double %195, ptr %194, align 16
  %196 = getelementptr inbounds { double, double }, ptr %193, i32 0, i32 1
  %197 = extractvalue { double, double } %190, 1
  store double %197, ptr %196, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #6
  br label %202

198:                                              ; preds = %179, %173
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %22, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #6
  br label %315

202:                                              ; preds = %191, %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %203 = invoke noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %29)
          to label %204 unwind label %219

204:                                              ; preds = %202
  store float %203, ptr %39, align 4, !tbaa !5
  %205 = load float, ptr %39, align 4, !tbaa !5
  %206 = fcmp ogt float %205, 0.000000e+00
  br i1 %206, label %207, label %313

207:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  store ptr %21, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  %208 = load ptr, ptr %40, align 8, !tbaa !9
  %209 = invoke noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528) %208)
          to label %210 unwind label %223

210:                                              ; preds = %207
  store ptr %209, ptr %41, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %211 = load ptr, ptr %40, align 8, !tbaa !9
  %212 = invoke noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528) %211)
          to label %213 unwind label %227

213:                                              ; preds = %210
  store ptr %212, ptr %42, align 8, !tbaa !9
  br label %214

214:                                              ; preds = %306, %213
  %215 = load ptr, ptr %41, align 8, !tbaa !9
  %216 = load ptr, ptr %42, align 8, !tbaa !9
  %217 = icmp ne ptr %215, %216
  br i1 %217, label %231, label %218

218:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  br label %312

219:                                              ; preds = %202
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %22, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %23, align 4
  br label %314

223:                                              ; preds = %207
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %22, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %23, align 4
  br label %311

227:                                              ; preds = %210
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %22, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %23, align 4
  br label %310

231:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #6
  %232 = load ptr, ptr %41, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %232, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %45) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !13
  %233 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 0
  %234 = load double, ptr %233, align 16
  %235 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 1
  %236 = load double, ptr %235, align 8
  %237 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %43, double %234, double %236)
          to label %238 unwind label %293

238:                                              ; preds = %231
  %239 = getelementptr inbounds %"class.JPH::Vec3", ptr %45, i32 0, i32 0
  %240 = getelementptr inbounds %union.anon, ptr %239, i32 0, i32 0
  %241 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 0
  %242 = extractvalue { double, double } %237, 0
  store double %242, ptr %241, align 16
  %243 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 1
  %244 = extractvalue { double, double } %237, 1
  store double %244, ptr %243, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 16 %29, i64 16, i1 false), !tbaa.struct !13
  %245 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 0
  %246 = load double, ptr %245, align 16
  %247 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 1
  %248 = load double, ptr %247, align 8
  %249 = invoke noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %45, double %246, double %248)
          to label %250 unwind label %293

250:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #6
  store float %249, ptr %44, align 4, !tbaa !5
  %251 = load float, ptr %44, align 4, !tbaa !5
  %252 = fcmp ole float %251, 0.000000e+00
  br i1 %252, label %261, label %253

253:                                              ; preds = %250
  %254 = load float, ptr %44, align 4, !tbaa !5
  %255 = invoke noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %254)
          to label %256 unwind label %297

256:                                              ; preds = %253
  %257 = load float, ptr %15, align 4, !tbaa !5
  %258 = load float, ptr %39, align 4, !tbaa !5
  %259 = fmul float %257, %258
  %260 = fcmp olt float %255, %259
  br i1 %260, label %261, label %305

261:                                              ; preds = %256, %250
  call void @llvm.lifetime.start.p0(i64 16, ptr %48) #6
  %262 = load float, ptr %44, align 4, !tbaa !5
  %263 = load float, ptr %39, align 4, !tbaa !5
  %264 = fdiv float %262, %263
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %50, ptr align 16 %29, i64 16, i1 false), !tbaa.struct !13
  %265 = getelementptr inbounds { double, double }, ptr %50, i32 0, i32 0
  %266 = load double, ptr %265, align 16
  %267 = getelementptr inbounds { double, double }, ptr %50, i32 0, i32 1
  %268 = load double, ptr %267, align 8
  %269 = invoke { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %264, double %266, double %268)
          to label %270 unwind label %301

270:                                              ; preds = %261
  %271 = getelementptr inbounds %"class.JPH::Vec3", ptr %49, i32 0, i32 0
  %272 = getelementptr inbounds %union.anon, ptr %271, i32 0, i32 0
  %273 = getelementptr inbounds { double, double }, ptr %272, i32 0, i32 0
  %274 = extractvalue { double, double } %269, 0
  store double %274, ptr %273, align 16
  %275 = getelementptr inbounds { double, double }, ptr %272, i32 0, i32 1
  %276 = extractvalue { double, double } %269, 1
  store double %276, ptr %275, align 8
  %277 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 0
  %278 = load double, ptr %277, align 16
  %279 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 1
  %280 = load double, ptr %279, align 8
  %281 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %43, double %278, double %280)
          to label %282 unwind label %301

282:                                              ; preds = %270
  %283 = getelementptr inbounds %"class.JPH::Vec3", ptr %48, i32 0, i32 0
  %284 = getelementptr inbounds %union.anon, ptr %283, i32 0, i32 0
  %285 = getelementptr inbounds { double, double }, ptr %284, i32 0, i32 0
  %286 = extractvalue { double, double } %281, 0
  store double %286, ptr %285, align 16
  %287 = getelementptr inbounds { double, double }, ptr %284, i32 0, i32 1
  %288 = extractvalue { double, double } %281, 1
  store double %288, ptr %287, align 8
  %289 = load ptr, ptr %18, align 8, !tbaa !9
  invoke void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %289, ptr noundef nonnull align 16 dereferenceable(16) %48)
          to label %290 unwind label %301

290:                                              ; preds = %282
  %291 = load ptr, ptr %19, align 8, !tbaa !9
  invoke void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %291, ptr noundef nonnull align 16 dereferenceable(16) %43)
          to label %292 unwind label %301

292:                                              ; preds = %290
  call void @llvm.lifetime.end.p0(i64 16, ptr %48) #6
  br label %305

293:                                              ; preds = %238, %231
  %294 = landingpad { ptr, i32 }
          cleanup
  %295 = extractvalue { ptr, i32 } %294, 0
  store ptr %295, ptr %22, align 8
  %296 = extractvalue { ptr, i32 } %294, 1
  store i32 %296, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #6
  br label %309

297:                                              ; preds = %253
  %298 = landingpad { ptr, i32 }
          cleanup
  %299 = extractvalue { ptr, i32 } %298, 0
  store ptr %299, ptr %22, align 8
  %300 = extractvalue { ptr, i32 } %298, 1
  store i32 %300, ptr %23, align 4
  br label %309

301:                                              ; preds = %290, %282, %270, %261
  %302 = landingpad { ptr, i32 }
          cleanup
  %303 = extractvalue { ptr, i32 } %302, 0
  store ptr %303, ptr %22, align 8
  %304 = extractvalue { ptr, i32 } %302, 1
  store i32 %304, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %48) #6
  br label %309

305:                                              ; preds = %292, %256
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #6
  br label %306

306:                                              ; preds = %305
  %307 = load ptr, ptr %41, align 8, !tbaa !9
  %308 = getelementptr inbounds %"class.JPH::Vec3", ptr %307, i32 1
  store ptr %308, ptr %41, align 8, !tbaa !9
  br label %214

309:                                              ; preds = %301, %297, %293
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #6
  br label %310

310:                                              ; preds = %309, %227
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  br label %311

311:                                              ; preds = %310, %223
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  br label %314

312:                                              ; preds = %218
  br label %313

313:                                              ; preds = %312, %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528) %21) #6
  call void @llvm.lifetime.end.p0(i64 528, ptr %21) #6
  br label %318

314:                                              ; preds = %311, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  br label %315

315:                                              ; preds = %314, %198, %169, %165
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  br label %316

316:                                              ; preds = %315, %161
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %317

317:                                              ; preds = %316, %79
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528) %21) #6
  call void @llvm.lifetime.end.p0(i64 528, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %327

318:                                              ; preds = %313, %62, %11
  %319 = load ptr, ptr %18, align 8, !tbaa !9
  %320 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040) %319)
  %321 = load i32, ptr %20, align 4, !tbaa !11
  %322 = icmp eq i32 %320, %321
  br i1 %322, label %323, label %326

323:                                              ; preds = %318
  %324 = load ptr, ptr %18, align 8, !tbaa !9
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %324, ptr noundef nonnull align 16 dereferenceable(16) %12)
  %325 = load ptr, ptr %19, align 8, !tbaa !9
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %325, ptr noundef nonnull align 16 dereferenceable(16) %13)
  br label %326

326:                                              ; preds = %323, %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  ret void

327:                                              ; preds = %317
  %328 = load ptr, ptr %22, align 8
  %329 = load i32, ptr %23, align 4
  %330 = insertvalue { ptr, i32 } poison, ptr %328, 0
  %331 = insertvalue { ptr, i32 } %330, i32 %329, 1
  resume { ptr, i32 } %331
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEC2Ev(ptr noundef nonnull align 16 dereferenceable(528)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14ClipPolyVsPolyINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S6_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528), ptr noundef nonnull align 16 dereferenceable(528), double, double, ptr noundef nonnull align 16 dereferenceable(528)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14ClipPolyVsEdgeINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S2_S2_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528), double, double, double, double, double, double, ptr noundef nonnull align 16 dereferenceable(528)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528)) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #6 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}


; 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::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::StaticArray.2" = type { i32, [12 x i8], [32 x %"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage" = type { [16 x i8] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH23ManifoldBetweenTwoFacesENS_4Vec3ES0_S0_fRKNS_11StaticArrayIS0_Lj32EEES4_RNS1_IS0_Lj64EEES6_(double %0, double %1, double %2, double %3, double %4, double %5, float noundef %6, ptr noundef nonnull align 16 dereferenceable(528) %7, ptr noundef nonnull align 16 dereferenceable(528) %8, ptr noundef nonnull align 16 dereferenceable(1040) %9, ptr noundef nonnull align 16 dereferenceable(1040) %10) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::StaticArray.2", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  store double %0, ptr %12, align 16
  %21 = getelementptr inbounds i8, ptr %12, i64 8
  store double %1, ptr %21, align 8
  store double %2, ptr %13, align 16
  %22 = getelementptr inbounds i8, ptr %13, i64 8
  store double %3, ptr %22, align 8
  %23 = tail call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040) %9)
  %24 = tail call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %25 = icmp ugt i32 %24, 1
  br i1 %25, label %26, label %124

26:                                               ; preds = %11
  %27 = tail call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %8)
  %28 = icmp ugt i32 %27, 2
  br i1 %28, label %29, label %124

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 528, ptr nonnull %14) #6
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEC2Ev(ptr noundef nonnull align 16 dereferenceable(528) %14) #6
  %30 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %31 = icmp ugt i32 %30, 2
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  invoke void @_ZN3JPH14ClipPolyVsPolyINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S6_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528) %8, ptr noundef nonnull align 16 dereferenceable(528) %7, double %4, double %5, ptr noundef nonnull align 16 dereferenceable(528) %14)
          to label %43 unwind label %33

33:                                               ; preds = %42, %40, %38, %32
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %123

35:                                               ; preds = %29
  %36 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %43

38:                                               ; preds = %35
  %39 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 0)
          to label %40 unwind label %33

40:                                               ; preds = %38
  %.sroa.036.0.copyload = load double, ptr %39, align 16
  %.sroa.237.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 8
  %.sroa.237.0.copyload = load double, ptr %.sroa.237.0..sroa_idx, align 8, !tbaa !5
  %41 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 1)
          to label %42 unwind label %33

42:                                               ; preds = %40
  %.sroa.034.0.copyload = load double, ptr %41, align 16
  %.sroa.235.0..sroa_idx = getelementptr inbounds i8, ptr %41, i64 8
  %.sroa.235.0.copyload = load double, ptr %.sroa.235.0..sroa_idx, align 8, !tbaa !5
  invoke void @_ZN3JPH14ClipPolyVsEdgeINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S2_S2_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528) %8, double %.sroa.036.0.copyload, double %.sroa.237.0.copyload, double %.sroa.034.0.copyload, double %.sroa.235.0.copyload, double %4, double %5, ptr noundef nonnull align 16 dereferenceable(528) %14)
          to label %43 unwind label %33

43:                                               ; preds = %35, %42, %32
  %44 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 0)
          to label %45 unwind label %66

45:                                               ; preds = %43
  %.sroa.031.0.copyload = load double, ptr %44, align 16
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  %.sroa.7.0.copyload = load double, ptr %.sroa.7.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #6
  %46 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 1)
          to label %47 unwind label %68

47:                                               ; preds = %45
  %48 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %46, double %.sroa.031.0.copyload, double %.sroa.7.0.copyload)
          to label %49 unwind label %68

49:                                               ; preds = %47
  %50 = extractvalue { double, double } %48, 0
  store double %50, ptr %16, align 16
  %51 = getelementptr inbounds i8, ptr %16, i64 8
  %52 = extractvalue { double, double } %48, 1
  store double %52, ptr %51, align 8
  %53 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %54 = icmp ugt i32 %53, 2
  br i1 %54, label %55, label %72

55:                                               ; preds = %49
  %56 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 2)
          to label %57 unwind label %70

57:                                               ; preds = %55
  %58 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %56, double %.sroa.031.0.copyload, double %.sroa.7.0.copyload)
          to label %59 unwind label %70

59:                                               ; preds = %57
  %60 = extractvalue { double, double } %58, 0
  %61 = extractvalue { double, double } %58, 1
  %62 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %16, double %60, double %61)
          to label %63 unwind label %70

63:                                               ; preds = %59
  %64 = extractvalue { double, double } %62, 0
  %65 = extractvalue { double, double } %62, 1
  store double %64, ptr %15, align 16
  %.sroa.528.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  store double %65, ptr %.sroa.528.0..sroa_idx, align 8, !tbaa !5
  br label %84

66:                                               ; preds = %43
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %123

68:                                               ; preds = %47, %45
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %122

70:                                               ; preds = %59, %57, %55
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %122

72:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #6
  %73 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %16, double %4, double %5)
          to label %74 unwind label %82

74:                                               ; preds = %72
  %75 = extractvalue { double, double } %73, 0
  store double %75, ptr %17, align 16
  %76 = getelementptr inbounds i8, ptr %17, i64 8
  %77 = extractvalue { double, double } %73, 1
  store double %77, ptr %76, align 8
  %.sroa.018.0.copyload = load double, ptr %16, align 16
  %.sroa.219.0.copyload = load double, ptr %51, align 8, !tbaa !5
  %78 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %.sroa.018.0.copyload, double %.sroa.219.0.copyload)
          to label %79 unwind label %82

79:                                               ; preds = %74
  %80 = extractvalue { double, double } %78, 0
  %81 = extractvalue { double, double } %78, 1
  store double %80, ptr %15, align 16
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  store double %81, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  br label %84

82:                                               ; preds = %74, %72
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  br label %122

84:                                               ; preds = %79, %63
  %85 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %15)
  %86 = fcmp ogt float %85, 0.000000e+00
  br i1 %86, label %87, label %.loopexit

87:                                               ; preds = %84
  %88 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528) %14)
  %89 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528) %14)
  %.not74 = icmp eq ptr %88, %89
  br i1 %.not74, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %87
  %90 = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %91 = fmul float %85, %6
  %92 = getelementptr inbounds i8, ptr %20, i64 8
  br label %93

93:                                               ; preds = %.lr.ph, %119
  %.06775 = phi ptr [ %88, %.lr.ph ], [ %120, %119 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %18, ptr noundef nonnull align 16 dereferenceable(16) %.06775, i64 16, i1 false), !tbaa.struct !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #6
  %94 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %18, double %.sroa.031.0.copyload, double %.sroa.7.0.copyload)
          to label %95 unwind label %115

95:                                               ; preds = %93
  %96 = extractvalue { double, double } %94, 0
  store double %96, ptr %19, align 16
  %97 = extractvalue { double, double } %94, 1
  store double %97, ptr %90, align 8
  %.sroa.03.0.copyload = load double, ptr %15, align 16
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !5
  %98 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %19, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  %99 = fcmp ugt float %98, 0.000000e+00
  br i1 %99, label %100, label %103

100:                                              ; preds = %95
  %101 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %98)
  %102 = fcmp olt float %101, %91
  br i1 %102, label %103, label %119

103:                                              ; preds = %100, %95
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #6
  %104 = fdiv float %98, %85
  %.sroa.0.0.copyload = load double, ptr %15, align 16
  %.sroa.2.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !5
  %105 = invoke { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %104, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
          to label %106 unwind label %117

106:                                              ; preds = %103
  %107 = extractvalue { double, double } %105, 0
  %108 = extractvalue { double, double } %105, 1
  %109 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %18, double %107, double %108)
          to label %110 unwind label %117

110:                                              ; preds = %106
  %111 = extractvalue { double, double } %109, 0
  store double %111, ptr %20, align 16
  %112 = extractvalue { double, double } %109, 1
  store double %112, ptr %92, align 8
  invoke void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %9, ptr noundef nonnull align 16 dereferenceable(16) %20)
          to label %113 unwind label %117

113:                                              ; preds = %110
  invoke void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %10, ptr noundef nonnull align 16 dereferenceable(16) %18)
          to label %114 unwind label %117

114:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  br label %119

115:                                              ; preds = %93
  %116 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  br label %121

117:                                              ; preds = %113, %110, %106, %103
  %118 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  br label %121

119:                                              ; preds = %114, %100
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  %120 = getelementptr inbounds i8, ptr %.06775, i64 16
  %.not = icmp eq ptr %120, %89
  br i1 %.not, label %.loopexit, label %93

121:                                              ; preds = %117, %115
  %.pn = phi { ptr, i32 } [ %118, %117 ], [ %116, %115 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  br label %122

.loopexit:                                        ; preds = %119, %87, %84
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528) %14) #6
  call void @llvm.lifetime.end.p0(i64 528, ptr nonnull %14) #6
  br label %124

122:                                              ; preds = %121, %82, %70, %68
  %.pn.pn = phi { ptr, i32 } [ %.pn, %121 ], [ %71, %70 ], [ %83, %82 ], [ %69, %68 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  br label %123

123:                                              ; preds = %66, %122, %33
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %34, %33 ], [ %.pn.pn, %122 ], [ %67, %66 ]
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528) %14) #6
  call void @llvm.lifetime.end.p0(i64 528, ptr nonnull %14) #6
  resume { ptr, i32 } %.pn.pn.pn.pn

124:                                              ; preds = %.loopexit, %26, %11
  %125 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj64EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(1040) %9)
  %126 = icmp eq i32 %125, %23
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %9, ptr noundef nonnull align 16 dereferenceable(16) %12)
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj64EE9push_backERKS1_(ptr noundef nonnull align 16 dereferenceable(1040) %10, ptr noundef nonnull align 16 dereferenceable(16) %13)
  br label %128

128:                                              ; preds = %127, %124
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEC2Ev(ptr noundef nonnull align 16 dereferenceable(528)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14ClipPolyVsPolyINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S6_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528), ptr noundef nonnull align 16 dereferenceable(528), double, double, ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14ClipPolyVsEdgeINS_11StaticArrayINS_4Vec3ELj32EEEEEvRKT_S2_S2_S2_RS4_(ptr noundef nonnull align 16 dereferenceable(528), double, double, double, double, double, double, ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EED2Ev(ptr noundef nonnull align 16 dereferenceable(528)) unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{i64 0, i64 16, !5}


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