; LLVM IR from ThePhysicsGuys/Physics3D :: Physics3D/geometry (builtinShapeClasses)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }
%struct.anon = type { double, double, double }

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK3P3D10WedgeClass23getIntersectionDistanceENS_6VectorIdLm3EEES2_(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef byval(%"struct.P3D::Vector") align 8 %1, ptr noundef byval(%"struct.P3D::Vector") align 8 %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca %"struct.P3D::Vector", align 8
  %8 = alloca %"struct.P3D::Vector", align 8
  %9 = alloca double, align 8
  %10 = alloca %"struct.P3D::Vector", align 8
  %11 = alloca %"struct.P3D::Vector", align 8
  %12 = alloca double, align 8
  %13 = alloca %"struct.P3D::Vector", align 8
  %14 = alloca %"struct.P3D::Vector", align 8
  %15 = alloca double, align 8
  %16 = alloca %"struct.P3D::Vector", align 8
  %17 = alloca %"struct.P3D::Vector", align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %"struct.P3D::Vector", align 8
  %21 = alloca %"struct.P3D::Vector", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %23 = call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #4
  store double %23, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %24 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %25 = getelementptr inbounds %struct.anon, ptr %24, i32 0, i32 1
  %26 = load double, ptr %25, align 8, !tbaa !11
  %27 = fsub double -1.000000e+00, %26
  %28 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %29 = getelementptr inbounds %struct.anon, ptr %28, i32 0, i32 1
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = fdiv double %27, %30
  store double %31, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  %32 = getelementptr inbounds %"struct.P3D::Vector", ptr %7, i32 0, i32 0
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 0
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = call noundef double @_ZSt3absd(double noundef %34)
  %36 = fcmp ole double %35, 1.000000e+00
  br i1 %36, label %37, label %58

37:                                               ; preds = %3
  %38 = getelementptr inbounds %"struct.P3D::Vector", ptr %7, i32 0, i32 0
  %39 = getelementptr inbounds %struct.anon, ptr %38, i32 0, i32 2
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = call noundef double @_ZSt3absd(double noundef %40)
  %42 = fcmp ole double %41, 1.000000e+00
  br i1 %42, label %43, label %58

43:                                               ; preds = %37
  %44 = getelementptr inbounds %"struct.P3D::Vector", ptr %7, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon, ptr %44, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fcmp ole double %46, 1.000000e+00
  br i1 %47, label %48, label %58

48:                                               ; preds = %43
  %49 = load double, ptr %6, align 8, !tbaa !9
  %50 = fcmp ogt double %49, 0.000000e+00
  br i1 %50, label %51, label %58

51:                                               ; preds = %48
  %52 = load double, ptr %6, align 8, !tbaa !9
  %53 = load double, ptr %5, align 8, !tbaa !9
  %54 = fcmp olt double %52, %53
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  %56 = load double, ptr %6, align 8, !tbaa !9
  store double %56, ptr %5, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %55, %51
  br label %58

58:                                               ; preds = %57, %48, %43, %37, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %59 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = fsub double -1.000000e+00, %61
  %63 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %64 = getelementptr inbounds %struct.anon, ptr %63, i32 0, i32 0
  %65 = load double, ptr %64, align 8, !tbaa !11
  %66 = fdiv double %62, %65
  store double %66, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  %67 = getelementptr inbounds %"struct.P3D::Vector", ptr %10, i32 0, i32 0
  %68 = getelementptr inbounds %struct.anon, ptr %67, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = call noundef double @_ZSt3absd(double noundef %69)
  %71 = fcmp ole double %70, 1.000000e+00
  br i1 %71, label %72, label %93

72:                                               ; preds = %58
  %73 = getelementptr inbounds %"struct.P3D::Vector", ptr %10, i32 0, i32 0
  %74 = getelementptr inbounds %struct.anon, ptr %73, i32 0, i32 2
  %75 = load double, ptr %74, align 8, !tbaa !11
  %76 = call noundef double @_ZSt3absd(double noundef %75)
  %77 = fcmp ole double %76, 1.000000e+00
  br i1 %77, label %78, label %93

78:                                               ; preds = %72
  %79 = getelementptr inbounds %"struct.P3D::Vector", ptr %10, i32 0, i32 0
  %80 = getelementptr inbounds %struct.anon, ptr %79, i32 0, i32 1
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = fcmp ole double %81, 1.000000e+00
  br i1 %82, label %83, label %93

83:                                               ; preds = %78
  %84 = load double, ptr %9, align 8, !tbaa !9
  %85 = fcmp ogt double %84, 0.000000e+00
  br i1 %85, label %86, label %93

86:                                               ; preds = %83
  %87 = load double, ptr %9, align 8, !tbaa !9
  %88 = load double, ptr %5, align 8, !tbaa !9
  %89 = fcmp olt double %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %86
  %91 = load double, ptr %9, align 8, !tbaa !9
  store double %91, ptr %5, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %90, %86
  br label %93

93:                                               ; preds = %92, %83, %78, %72, %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %94 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon, ptr %94, i32 0, i32 2
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = fsub double -1.000000e+00, %96
  %98 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %99 = getelementptr inbounds %struct.anon, ptr %98, i32 0, i32 2
  %100 = load double, ptr %99, align 8, !tbaa !11
  %101 = fdiv double %97, %100
  store double %101, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %14, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  %102 = getelementptr inbounds %"struct.P3D::Vector", ptr %13, i32 0, i32 0
  %103 = getelementptr inbounds %struct.anon, ptr %102, i32 0, i32 0
  %104 = load double, ptr %103, align 8, !tbaa !11
  %105 = call noundef double @_ZSt3absd(double noundef %104)
  %106 = fcmp ole double %105, 1.000000e+00
  br i1 %106, label %107, label %132

107:                                              ; preds = %93
  %108 = getelementptr inbounds %"struct.P3D::Vector", ptr %13, i32 0, i32 0
  %109 = getelementptr inbounds %struct.anon, ptr %108, i32 0, i32 1
  %110 = load double, ptr %109, align 8, !tbaa !11
  %111 = call noundef double @_ZSt3absd(double noundef %110)
  %112 = fcmp ole double %111, 1.000000e+00
  br i1 %112, label %113, label %132

113:                                              ; preds = %107
  %114 = getelementptr inbounds %"struct.P3D::Vector", ptr %13, i32 0, i32 0
  %115 = getelementptr inbounds %struct.anon, ptr %114, i32 0, i32 0
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = getelementptr inbounds %"struct.P3D::Vector", ptr %13, i32 0, i32 0
  %118 = getelementptr inbounds %struct.anon, ptr %117, i32 0, i32 1
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = fadd double %116, %119
  %121 = fcmp ole double %120, 0.000000e+00
  br i1 %121, label %122, label %132

122:                                              ; preds = %113
  %123 = load double, ptr %12, align 8, !tbaa !9
  %124 = fcmp ogt double %123, 0.000000e+00
  br i1 %124, label %125, label %132

125:                                              ; preds = %122
  %126 = load double, ptr %12, align 8, !tbaa !9
  %127 = load double, ptr %5, align 8, !tbaa !9
  %128 = fcmp olt double %126, %127
  br i1 %128, label %129, label %131

129:                                              ; preds = %125
  %130 = load double, ptr %12, align 8, !tbaa !9
  store double %130, ptr %5, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %129, %125
  br label %132

132:                                              ; preds = %131, %122, %113, %107, %93
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %133 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %134 = getelementptr inbounds %struct.anon, ptr %133, i32 0, i32 2
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = fsub double 1.000000e+00, %135
  %137 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %138 = getelementptr inbounds %struct.anon, ptr %137, i32 0, i32 2
  %139 = load double, ptr %138, align 8, !tbaa !11
  %140 = fdiv double %136, %139
  store double %140, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #4
  %141 = getelementptr inbounds %"struct.P3D::Vector", ptr %16, i32 0, i32 0
  %142 = getelementptr inbounds %struct.anon, ptr %141, i32 0, i32 0
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = call noundef double @_ZSt3absd(double noundef %143)
  %145 = fcmp ole double %144, 1.000000e+00
  br i1 %145, label %146, label %171

146:                                              ; preds = %132
  %147 = getelementptr inbounds %"struct.P3D::Vector", ptr %16, i32 0, i32 0
  %148 = getelementptr inbounds %struct.anon, ptr %147, i32 0, i32 1
  %149 = load double, ptr %148, align 8, !tbaa !11
  %150 = call noundef double @_ZSt3absd(double noundef %149)
  %151 = fcmp ole double %150, 1.000000e+00
  br i1 %151, label %152, label %171

152:                                              ; preds = %146
  %153 = getelementptr inbounds %"struct.P3D::Vector", ptr %16, i32 0, i32 0
  %154 = getelementptr inbounds %struct.anon, ptr %153, i32 0, i32 0
  %155 = load double, ptr %154, align 8, !tbaa !11
  %156 = getelementptr inbounds %"struct.P3D::Vector", ptr %16, i32 0, i32 0
  %157 = getelementptr inbounds %struct.anon, ptr %156, i32 0, i32 1
  %158 = load double, ptr %157, align 8, !tbaa !11
  %159 = fadd double %155, %158
  %160 = fcmp ole double %159, 0.000000e+00
  br i1 %160, label %161, label %171

161:                                              ; preds = %152
  %162 = load double, ptr %15, align 8, !tbaa !9
  %163 = fcmp ogt double %162, 0.000000e+00
  br i1 %163, label %164, label %171

164:                                              ; preds = %161
  %165 = load double, ptr %15, align 8, !tbaa !9
  %166 = load double, ptr %5, align 8, !tbaa !9
  %167 = fcmp olt double %165, %166
  br i1 %167, label %168, label %170

168:                                              ; preds = %164
  %169 = load double, ptr %15, align 8, !tbaa !9
  store double %169, ptr %5, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %168, %164
  br label %171

171:                                              ; preds = %170, %161, %152, %146, %132
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %172 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %173 = getelementptr inbounds %struct.anon, ptr %172, i32 0, i32 0
  %174 = load double, ptr %173, align 8, !tbaa !11
  %175 = getelementptr inbounds %"struct.P3D::Vector", ptr %2, i32 0, i32 0
  %176 = getelementptr inbounds %struct.anon, ptr %175, i32 0, i32 1
  %177 = load double, ptr %176, align 8, !tbaa !11
  %178 = fadd double %174, %177
  store double %178, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %179 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %180 = getelementptr inbounds %struct.anon, ptr %179, i32 0, i32 0
  %181 = load double, ptr %180, align 8, !tbaa !11
  %182 = fneg double %181
  %183 = getelementptr inbounds %"struct.P3D::Vector", ptr %1, i32 0, i32 0
  %184 = getelementptr inbounds %struct.anon, ptr %183, i32 0, i32 1
  %185 = load double, ptr %184, align 8, !tbaa !11
  %186 = fsub double %182, %185
  %187 = load double, ptr %18, align 8, !tbaa !9
  %188 = fdiv double %186, %187
  store double %188, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %21, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  %189 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %190 = getelementptr inbounds %struct.anon, ptr %189, i32 0, i32 0
  %191 = load double, ptr %190, align 8, !tbaa !11
  %192 = call noundef double @_ZSt3absd(double noundef %191)
  %193 = fcmp ole double %192, 1.000000e+00
  br i1 %193, label %194, label %216

194:                                              ; preds = %171
  %195 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %196 = getelementptr inbounds %struct.anon, ptr %195, i32 0, i32 1
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = call noundef double @_ZSt3absd(double noundef %197)
  %199 = fcmp ole double %198, 1.000000e+00
  br i1 %199, label %200, label %216

200:                                              ; preds = %194
  %201 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %202 = getelementptr inbounds %struct.anon, ptr %201, i32 0, i32 2
  %203 = load double, ptr %202, align 8, !tbaa !11
  %204 = call noundef double @_ZSt3absd(double noundef %203)
  %205 = fcmp ole double %204, 1.000000e+00
  br i1 %205, label %206, label %216

206:                                              ; preds = %200
  %207 = load double, ptr %19, align 8, !tbaa !9
  %208 = fcmp ogt double %207, 0.000000e+00
  br i1 %208, label %209, label %216

209:                                              ; preds = %206
  %210 = load double, ptr %19, align 8, !tbaa !9
  %211 = load double, ptr %5, align 8, !tbaa !9
  %212 = fcmp olt double %210, %211
  br i1 %212, label %213, label %215

213:                                              ; preds = %209
  %214 = load double, ptr %19, align 8, !tbaa !9
  store double %214, ptr %5, align 8, !tbaa !9
  br label %215

215:                                              ; preds = %213, %209
  br label %216

216:                                              ; preds = %215, %206, %200, %194, %171
  %217 = load double, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret double %217
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!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"

%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK3P3D10WedgeClass23getIntersectionDistanceENS_6VectorIdLm3EEES2_(ptr nocapture noundef nonnull readnone align 8 dereferenceable(104) %0, ptr noundef byval(%"struct.P3D::Vector") align 8 %1, ptr noundef byval(%"struct.P3D::Vector") align 8 %2) unnamed_addr #2 align 2 {
  %4 = alloca double, align 8
  %5 = alloca %"struct.P3D::Vector", align 8
  %6 = alloca %"struct.P3D::Vector", align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.P3D::Vector", align 8
  %9 = alloca %"struct.P3D::Vector", align 8
  %10 = alloca double, align 8
  %11 = alloca %"struct.P3D::Vector", align 8
  %12 = alloca %"struct.P3D::Vector", align 8
  %13 = alloca double, align 8
  %14 = alloca %"struct.P3D::Vector", align 8
  %15 = alloca %"struct.P3D::Vector", align 8
  %16 = alloca double, align 8
  %17 = alloca %"struct.P3D::Vector", align 8
  %18 = alloca %"struct.P3D::Vector", align 8
  %19 = tail call noundef double @_ZNSt14numeric_limitsIdE3maxEv() #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %20 = getelementptr inbounds i8, ptr %1, i64 8
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = fsub double -1.000000e+00, %21
  %23 = getelementptr inbounds i8, ptr %2, i64 8
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = fdiv double %22, %24
  store double %25, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  %26 = load double, ptr %5, align 8, !tbaa !5
  %27 = call noundef double @_ZSt3absd(double noundef %26)
  %28 = fcmp ugt double %27, 1.000000e+00
  br i1 %28, label %41, label %29

29:                                               ; preds = %3
  %30 = getelementptr inbounds i8, ptr %5, i64 16
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = call noundef double @_ZSt3absd(double noundef %31)
  %33 = fcmp ole double %32, 1.000000e+00
  %34 = load double, ptr %5, align 8
  %35 = fcmp ole double %34, 1.000000e+00
  %or.cond = select i1 %33, i1 %35, i1 false
  %36 = load double, ptr %4, align 8
  %37 = fcmp ogt double %36, 0.000000e+00
  %38 = fcmp olt double %36, %19
  %39 = and i1 %37, %38
  %or.cond31 = select i1 %or.cond, i1 %39, i1 false
  br i1 %or.cond31, label %40, label %41

40:                                               ; preds = %29
  br label %41

41:                                               ; preds = %40, %29, %3
  %.0 = phi double [ %36, %40 ], [ %19, %29 ], [ %19, %3 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %42 = load double, ptr %1, align 8, !tbaa !5
  %43 = fsub double -1.000000e+00, %42
  %44 = load double, ptr %2, align 8, !tbaa !5
  %45 = fdiv double %43, %44
  store double %45, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #3
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #3
  %46 = getelementptr inbounds i8, ptr %8, i64 8
  %47 = load double, ptr %46, align 8, !tbaa !5
  %48 = call noundef double @_ZSt3absd(double noundef %47)
  %49 = fcmp ugt double %48, 1.000000e+00
  br i1 %49, label %61, label %50

50:                                               ; preds = %41
  %51 = getelementptr inbounds i8, ptr %8, i64 16
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = call noundef double @_ZSt3absd(double noundef %52)
  %54 = fcmp ole double %53, 1.000000e+00
  %55 = load double, ptr %46, align 8
  %56 = fcmp ole double %55, 1.000000e+00
  %or.cond9 = select i1 %54, i1 %56, i1 false
  %57 = load double, ptr %7, align 8
  %58 = fcmp ogt double %57, 0.000000e+00
  %or.cond11 = select i1 %or.cond9, i1 %58, i1 false
  %59 = fcmp olt double %57, %.0
  %or.cond32 = select i1 %or.cond11, i1 %59, i1 false
  br i1 %or.cond32, label %60, label %61

60:                                               ; preds = %50
  br label %61

61:                                               ; preds = %60, %50, %41
  %.1 = phi double [ %57, %60 ], [ %.0, %50 ], [ %.0, %41 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %62 = getelementptr inbounds i8, ptr %1, i64 16
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = fsub double -1.000000e+00, %63
  %65 = getelementptr inbounds i8, ptr %2, i64 16
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = fdiv double %64, %66
  store double %67, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #3
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #3
  %68 = load double, ptr %11, align 8, !tbaa !5
  %69 = call noundef double @_ZSt3absd(double noundef %68)
  %70 = fcmp ugt double %69, 1.000000e+00
  br i1 %70, label %85, label %71

71:                                               ; preds = %61
  %72 = getelementptr inbounds i8, ptr %11, i64 8
  %73 = load double, ptr %72, align 8, !tbaa !5
  %74 = call noundef double @_ZSt3absd(double noundef %73)
  %75 = fcmp ugt double %74, 1.000000e+00
  br i1 %75, label %85, label %76

76:                                               ; preds = %71
  %77 = load double, ptr %11, align 8, !tbaa !5
  %78 = load double, ptr %72, align 8, !tbaa !5
  %79 = fadd double %77, %78
  %80 = fcmp ole double %79, 0.000000e+00
  %81 = load double, ptr %10, align 8
  %82 = fcmp ogt double %81, 0.000000e+00
  %or.cond13 = select i1 %80, i1 %82, i1 false
  %83 = fcmp olt double %81, %.1
  %or.cond33 = select i1 %or.cond13, i1 %83, i1 false
  br i1 %or.cond33, label %84, label %85

84:                                               ; preds = %76
  br label %85

85:                                               ; preds = %84, %76, %71, %61
  %.2 = phi double [ %81, %84 ], [ %.1, %76 ], [ %.1, %71 ], [ %.1, %61 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  %86 = load double, ptr %62, align 8, !tbaa !5
  %87 = fsub double 1.000000e+00, %86
  %88 = load double, ptr %65, align 8, !tbaa !5
  %89 = fdiv double %87, %88
  store double %89, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #3
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %15, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #3
  %90 = load double, ptr %14, align 8, !tbaa !5
  %91 = call noundef double @_ZSt3absd(double noundef %90)
  %92 = fcmp ugt double %91, 1.000000e+00
  br i1 %92, label %107, label %93

93:                                               ; preds = %85
  %94 = getelementptr inbounds i8, ptr %14, i64 8
  %95 = load double, ptr %94, align 8, !tbaa !5
  %96 = call noundef double @_ZSt3absd(double noundef %95)
  %97 = fcmp ugt double %96, 1.000000e+00
  br i1 %97, label %107, label %98

98:                                               ; preds = %93
  %99 = load double, ptr %14, align 8, !tbaa !5
  %100 = load double, ptr %94, align 8, !tbaa !5
  %101 = fadd double %99, %100
  %102 = fcmp ole double %101, 0.000000e+00
  %103 = load double, ptr %13, align 8
  %104 = fcmp ogt double %103, 0.000000e+00
  %or.cond15 = select i1 %102, i1 %104, i1 false
  %105 = fcmp olt double %103, %.2
  %or.cond34 = select i1 %or.cond15, i1 %105, i1 false
  br i1 %or.cond34, label %106, label %107

106:                                              ; preds = %98
  br label %107

107:                                              ; preds = %106, %98, %93, %85
  %.3 = phi double [ %103, %106 ], [ %.2, %98 ], [ %.2, %93 ], [ %.2, %85 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  %108 = load double, ptr %2, align 8, !tbaa !5
  %109 = load double, ptr %23, align 8, !tbaa !5
  %110 = fadd double %108, %109
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #3
  %111 = load double, ptr %1, align 8, !tbaa !5
  %112 = fneg double %111
  %113 = load double, ptr %20, align 8, !tbaa !5
  %114 = fsub double %112, %113
  %115 = fdiv double %114, %110
  store double %115, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #3
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %18, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @_ZN3P3DplIddLm3EEENS_6VectorIDTplixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #3
  %116 = load double, ptr %17, align 8, !tbaa !5
  %117 = call noundef double @_ZSt3absd(double noundef %116)
  %118 = fcmp ugt double %117, 1.000000e+00
  br i1 %118, label %133, label %119

119:                                              ; preds = %107
  %120 = getelementptr inbounds i8, ptr %17, i64 8
  %121 = load double, ptr %120, align 8, !tbaa !5
  %122 = call noundef double @_ZSt3absd(double noundef %121)
  %123 = fcmp ugt double %122, 1.000000e+00
  br i1 %123, label %133, label %124

124:                                              ; preds = %119
  %125 = getelementptr inbounds i8, ptr %17, i64 16
  %126 = load double, ptr %125, align 8, !tbaa !5
  %127 = call noundef double @_ZSt3absd(double noundef %126)
  %128 = fcmp ole double %127, 1.000000e+00
  %129 = load double, ptr %16, align 8
  %130 = fcmp ogt double %129, 0.000000e+00
  %or.cond17 = select i1 %128, i1 %130, i1 false
  %131 = fcmp olt double %129, %.3
  %or.cond35 = select i1 %or.cond17, i1 %131, i1 false
  br i1 %or.cond35, label %132, label %133

132:                                              ; preds = %124
  br label %133

133:                                              ; preds = %132, %124, %119, %107
  %.4 = phi double [ %129, %132 ], [ %.3, %124 ], [ %.3, %119 ], [ %.3, %107 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret double %.4
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE3maxEv() local_unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!9, !9, i64 0}
!9 = !{!"double", !6, i64 0}


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