; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src/collision.ll (ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_)

; 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.vmath::vec3" = type { float, float, float }

; 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(...)

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

declare void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca %"class.vmath::vec3", align 4
  %34 = alloca %"class.vmath::vec3", align 4
  %35 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  call void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %36 unwind label %95

36:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %37 unwind label %99

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %38 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %39 unwind label %103

39:                                               ; preds = %37
  %40 = fpext float %38 to double
  store double %40, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %41 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %42 unwind label %107

42:                                               ; preds = %39
  %43 = fpext float %41 to double
  store double %43, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %44 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %45 unwind label %111

45:                                               ; preds = %42
  %46 = fpext float %44 to double
  store double %46, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %47 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %48 unwind label %115

48:                                               ; preds = %45
  %49 = fpext float %47 to double
  store double %49, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %50 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %51 unwind label %119

51:                                               ; preds = %48
  %52 = fpext float %50 to double
  store double %52, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %53 = load double, ptr %16, align 8, !tbaa !9
  %54 = load double, ptr %18, align 8, !tbaa !9
  %55 = load double, ptr %17, align 8, !tbaa !9
  %56 = load double, ptr %17, align 8, !tbaa !9
  %57 = fmul double %55, %56
  %58 = fneg double %57
  %59 = call double @llvm.fmuladd.f64(double %53, double %54, double %58)
  store double %59, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %60 = load double, ptr %17, align 8, !tbaa !9
  %61 = load double, ptr %20, align 8, !tbaa !9
  %62 = load double, ptr %18, align 8, !tbaa !9
  %63 = load double, ptr %19, align 8, !tbaa !9
  %64 = fmul double %62, %63
  %65 = fneg double %64
  %66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
  store double %66, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %67 = load double, ptr %17, align 8, !tbaa !9
  %68 = load double, ptr %19, align 8, !tbaa !9
  %69 = load double, ptr %16, align 8, !tbaa !9
  %70 = load double, ptr %20, align 8, !tbaa !9
  %71 = fmul double %69, %70
  %72 = fneg double %71
  %73 = call double @llvm.fmuladd.f64(double %67, double %68, double %72)
  store double %73, ptr %23, align 8, !tbaa !9
  %74 = load double, ptr %22, align 8, !tbaa !9
  %75 = load double, ptr %23, align 8, !tbaa !9
  %76 = fadd double %74, %75
  %77 = load double, ptr %21, align 8, !tbaa !9
  %78 = fcmp olt double %76, %77
  br i1 %78, label %79, label %164

79:                                               ; preds = %51
  %80 = load double, ptr %22, align 8, !tbaa !9
  %81 = fcmp olt double %80, 0.000000e+00
  br i1 %81, label %82, label %143

82:                                               ; preds = %79
  %83 = load double, ptr %23, align 8, !tbaa !9
  %84 = fcmp olt double %83, 0.000000e+00
  br i1 %84, label %85, label %135

85:                                               ; preds = %82
  %86 = load double, ptr %19, align 8, !tbaa !9
  %87 = fcmp olt double %86, 0.000000e+00
  br i1 %87, label %88, label %127

88:                                               ; preds = %85
  %89 = load double, ptr %19, align 8, !tbaa !9
  %90 = fneg double %89
  %91 = load double, ptr %16, align 8, !tbaa !9
  %92 = fdiv double %90, %91
  %93 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %92, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %94 unwind label %123

94:                                               ; preds = %88
  store double %93, ptr %22, align 8, !tbaa !9
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  br label %134

95:                                               ; preds = %5
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %13, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %14, align 4
  br label %314

99:                                               ; preds = %36
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %13, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %14, align 4
  br label %313

103:                                              ; preds = %37
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %13, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %14, align 4
  br label %312

107:                                              ; preds = %39
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %13, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %14, align 4
  br label %311

111:                                              ; preds = %42
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %13, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %14, align 4
  br label %310

115:                                              ; preds = %45
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %13, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %14, align 4
  br label %309

119:                                              ; preds = %48
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %13, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %14, align 4
  br label %308

123:                                              ; preds = %245, %146, %135, %127, %88
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %13, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %14, align 4
  br label %307

127:                                              ; preds = %85
  store double 0.000000e+00, ptr %22, align 8, !tbaa !9
  %128 = load double, ptr %20, align 8, !tbaa !9
  %129 = fneg double %128
  %130 = load double, ptr %18, align 8, !tbaa !9
  %131 = fdiv double %129, %130
  %132 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %131, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %133 unwind label %123

133:                                              ; preds = %127
  store double %132, ptr %23, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %133, %94
  br label %142

135:                                              ; preds = %82
  store double 0.000000e+00, ptr %22, align 8, !tbaa !9
  %136 = load double, ptr %20, align 8, !tbaa !9
  %137 = fneg double %136
  %138 = load double, ptr %18, align 8, !tbaa !9
  %139 = fdiv double %137, %138
  %140 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %139, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %141 unwind label %123

141:                                              ; preds = %135
  store double %140, ptr %23, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %141, %134
  br label %163

143:                                              ; preds = %79
  %144 = load double, ptr %23, align 8, !tbaa !9
  %145 = fcmp olt double %144, 0.000000e+00
  br i1 %145, label %146, label %153

146:                                              ; preds = %143
  %147 = load double, ptr %19, align 8, !tbaa !9
  %148 = fneg double %147
  %149 = load double, ptr %16, align 8, !tbaa !9
  %150 = fdiv double %148, %149
  %151 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %150, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %152 unwind label %123

152:                                              ; preds = %146
  store double %151, ptr %22, align 8, !tbaa !9
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  br label %162

153:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %154 = load double, ptr %21, align 8, !tbaa !9
  %155 = fdiv double 1.000000e+00, %154
  store double %155, ptr %24, align 8, !tbaa !9
  %156 = load double, ptr %24, align 8, !tbaa !9
  %157 = load double, ptr %22, align 8, !tbaa !9
  %158 = fmul double %157, %156
  store double %158, ptr %22, align 8, !tbaa !9
  %159 = load double, ptr %24, align 8, !tbaa !9
  %160 = load double, ptr %23, align 8, !tbaa !9
  %161 = fmul double %160, %159
  store double %161, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %162

162:                                              ; preds = %153, %152
  br label %163

163:                                              ; preds = %162, %142
  br label %279

164:                                              ; preds = %51
  %165 = load double, ptr %22, align 8, !tbaa !9
  %166 = fcmp olt double %165, 0.000000e+00
  br i1 %166, label %167, label %210

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %168 = load double, ptr %17, align 8, !tbaa !9
  %169 = load double, ptr %19, align 8, !tbaa !9
  %170 = fadd double %168, %169
  store double %170, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %171 = load double, ptr %18, align 8, !tbaa !9
  %172 = load double, ptr %20, align 8, !tbaa !9
  %173 = fadd double %171, %172
  store double %173, ptr %26, align 8, !tbaa !9
  %174 = load double, ptr %26, align 8, !tbaa !9
  %175 = load double, ptr %25, align 8, !tbaa !9
  %176 = fcmp ogt double %174, %175
  br i1 %176, label %177, label %197

177:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %178 = load double, ptr %26, align 8, !tbaa !9
  %179 = load double, ptr %25, align 8, !tbaa !9
  %180 = fsub double %178, %179
  store double %180, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %181 = load double, ptr %16, align 8, !tbaa !9
  %182 = load double, ptr %17, align 8, !tbaa !9
  %183 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %182, double %181)
  %184 = load double, ptr %18, align 8, !tbaa !9
  %185 = fadd double %183, %184
  store double %185, ptr %28, align 8, !tbaa !9
  %186 = load double, ptr %27, align 8, !tbaa !9
  %187 = load double, ptr %28, align 8, !tbaa !9
  %188 = fdiv double %186, %187
  %189 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %188, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %190 unwind label %193

190:                                              ; preds = %177
  store double %189, ptr %22, align 8, !tbaa !9
  %191 = load double, ptr %22, align 8, !tbaa !9
  %192 = fsub double 1.000000e+00, %191
  store double %192, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %208

193:                                              ; preds = %177
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %13, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %209

197:                                              ; preds = %167
  %198 = load double, ptr %20, align 8, !tbaa !9
  %199 = fneg double %198
  %200 = load double, ptr %18, align 8, !tbaa !9
  %201 = fdiv double %199, %200
  %202 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %201, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %203 unwind label %204

203:                                              ; preds = %197
  store double %202, ptr %23, align 8, !tbaa !9
  store double 0.000000e+00, ptr %22, align 8, !tbaa !9
  br label %208

204:                                              ; preds = %197
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %13, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %14, align 4
  br label %209

208:                                              ; preds = %203, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %278

209:                                              ; preds = %204, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %307

210:                                              ; preds = %164
  %211 = load double, ptr %23, align 8, !tbaa !9
  %212 = fcmp olt double %211, 0.000000e+00
  br i1 %212, label %213, label %253

213:                                              ; preds = %210
  %214 = load double, ptr %16, align 8, !tbaa !9
  %215 = load double, ptr %19, align 8, !tbaa !9
  %216 = fadd double %214, %215
  %217 = load double, ptr %17, align 8, !tbaa !9
  %218 = load double, ptr %20, align 8, !tbaa !9
  %219 = fadd double %217, %218
  %220 = fcmp ogt double %216, %219
  br i1 %220, label %221, label %245

221:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %222 = load double, ptr %18, align 8, !tbaa !9
  %223 = load double, ptr %20, align 8, !tbaa !9
  %224 = fadd double %222, %223
  %225 = load double, ptr %17, align 8, !tbaa !9
  %226 = fsub double %224, %225
  %227 = load double, ptr %19, align 8, !tbaa !9
  %228 = fsub double %226, %227
  store double %228, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %229 = load double, ptr %16, align 8, !tbaa !9
  %230 = load double, ptr %17, align 8, !tbaa !9
  %231 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %230, double %229)
  %232 = load double, ptr %18, align 8, !tbaa !9
  %233 = fadd double %231, %232
  store double %233, ptr %30, align 8, !tbaa !9
  %234 = load double, ptr %29, align 8, !tbaa !9
  %235 = load double, ptr %30, align 8, !tbaa !9
  %236 = fdiv double %234, %235
  %237 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %236, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %238 unwind label %241

238:                                              ; preds = %221
  store double %237, ptr %22, align 8, !tbaa !9
  %239 = load double, ptr %22, align 8, !tbaa !9
  %240 = fsub double 1.000000e+00, %239
  store double %240, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %252

241:                                              ; preds = %221
  %242 = landingpad { ptr, i32 }
          cleanup
  %243 = extractvalue { ptr, i32 } %242, 0
  store ptr %243, ptr %13, align 8
  %244 = extractvalue { ptr, i32 } %242, 1
  store i32 %244, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %307

245:                                              ; preds = %213
  %246 = load double, ptr %20, align 8, !tbaa !9
  %247 = fneg double %246
  %248 = load double, ptr %18, align 8, !tbaa !9
  %249 = fdiv double %247, %248
  %250 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %249, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %251 unwind label %123

251:                                              ; preds = %245
  store double %250, ptr %22, align 8, !tbaa !9
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  br label %252

252:                                              ; preds = %251, %238
  br label %277

253:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %254 = load double, ptr %18, align 8, !tbaa !9
  %255 = load double, ptr %20, align 8, !tbaa !9
  %256 = fadd double %254, %255
  %257 = load double, ptr %17, align 8, !tbaa !9
  %258 = fsub double %256, %257
  %259 = load double, ptr %19, align 8, !tbaa !9
  %260 = fsub double %258, %259
  store double %260, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %261 = load double, ptr %16, align 8, !tbaa !9
  %262 = load double, ptr %17, align 8, !tbaa !9
  %263 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %262, double %261)
  %264 = load double, ptr %18, align 8, !tbaa !9
  %265 = fadd double %263, %264
  store double %265, ptr %32, align 8, !tbaa !9
  %266 = load double, ptr %31, align 8, !tbaa !9
  %267 = load double, ptr %32, align 8, !tbaa !9
  %268 = fdiv double %266, %267
  %269 = invoke noundef double @_ZN9Collision6_clampEddd(double noundef %268, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %270 unwind label %273

270:                                              ; preds = %253
  store double %269, ptr %22, align 8, !tbaa !9
  %271 = load double, ptr %22, align 8, !tbaa !9
  %272 = fsub double 1.000000e+00, %271
  store double %272, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %277

273:                                              ; preds = %253
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %13, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %307

277:                                              ; preds = %270, %252
  br label %278

278:                                              ; preds = %277, %208
  br label %279

279:                                              ; preds = %278, %163
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %34) #7
  %280 = load double, ptr %22, align 8, !tbaa !9
  %281 = fptrunc double %280 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %34, float noundef %281, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %282 unwind label %288

282:                                              ; preds = %279
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %33, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %34)
          to label %283 unwind label %292

283:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 12, ptr %35) #7
  %284 = load double, ptr %23, align 8, !tbaa !9
  %285 = fptrunc double %284 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %35, float noundef %285, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %286 unwind label %296

286:                                              ; preds = %283
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %33, ptr noundef nonnull align 4 dereferenceable(12) %35)
          to label %287 unwind label %300

287:                                              ; preds = %286
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %35) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %33) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  ret void

288:                                              ; preds = %279
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %13, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %14, align 4
  br label %306

292:                                              ; preds = %282
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %13, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %14, align 4
  br label %305

296:                                              ; preds = %283
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %13, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %14, align 4
  br label %304

300:                                              ; preds = %286
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %13, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %14, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %35) #7
  br label %304

304:                                              ; preds = %300, %296
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %33) #7
  br label %305

305:                                              ; preds = %304, %292
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %34) #7
  br label %306

306:                                              ; preds = %305, %288
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #7
  br label %307

307:                                              ; preds = %306, %273, %241, %209, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %308

308:                                              ; preds = %307, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %309

309:                                              ; preds = %308, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %310

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

311:                                              ; preds = %310, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %312

312:                                              ; preds = %311, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  br label %313

313:                                              ; preds = %312, %99
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #7
  br label %314

314:                                              ; preds = %313, %95
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  br label %315

315:                                              ; preds = %314
  %316 = load ptr, ptr %13, align 8
  %317 = load i32, ptr %14, align 4
  %318 = insertvalue { ptr, i32 } poison, ptr %316, 0
  %319 = insertvalue { ptr, i32 } %318, i32 %317, 1
  resume { ptr, i32 } %319
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN9Collision6_clampEddd(double noundef, double noundef, double noundef) #6

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


; 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.vmath::vec3" = type { float, float, float }

; 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(...)

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

declare void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef %4) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  call void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %12 unwind label %52

12:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %13 unwind label %54

13:                                               ; preds = %12
  %14 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %15 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %16 = fpext float %15 to double
  %17 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %18 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %19 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %20 = fneg double %16
  %21 = fmul double %20, %16
  %22 = insertelement <2 x float> poison, float %14, i64 0
  %23 = insertelement <2 x float> %22, float %17, i64 1
  %24 = fpext <2 x float> %23 to <2 x double>
  %25 = insertelement <2 x float> poison, float %18, i64 0
  %26 = insertelement <2 x float> %25, float %19, i64 1
  %27 = fpext <2 x float> %26 to <2 x double>
  %28 = extractelement <2 x double> %24, i64 0
  %29 = extractelement <2 x double> %24, i64 1
  %30 = call double @llvm.fmuladd.f64(double %28, double %29, double %21)
  %31 = fneg <2 x double> %24
  %32 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> <i32 1, i32 0>
  %33 = fmul <2 x double> %32, %31
  %34 = insertelement <2 x double> poison, double %16, i64 0
  %35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
  %36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %35, <2 x double> %27, <2 x double> %33)
  %37 = extractelement <2 x double> %36, i64 0
  %38 = extractelement <2 x double> %36, i64 1
  %39 = fadd double %38, %37
  %40 = fcmp olt double %39, %30
  %41 = fcmp olt double %38, 0.000000e+00
  br i1 %40, label %42, label %76

42:                                               ; preds = %13
  %43 = fcmp olt double %37, 0.000000e+00
  br i1 %41, label %44, label %66

44:                                               ; preds = %42
  br i1 %43, label %45, label %61

45:                                               ; preds = %44
  %46 = fcmp olt float %18, 0.000000e+00
  br i1 %46, label %47, label %56

47:                                               ; preds = %45
  %48 = extractelement <2 x double> %27, i64 0
  %49 = fneg double %48
  %50 = fdiv double %49, %28
  %51 = call noundef double @_ZN9Collision6_clampEddd(double noundef %50, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

52:                                               ; preds = %5
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %146

54:                                               ; preds = %12
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %145

56:                                               ; preds = %45
  %57 = extractelement <2 x double> %27, i64 1
  %58 = fneg double %57
  %59 = fdiv double %58, %29
  %60 = call noundef double @_ZN9Collision6_clampEddd(double noundef %59, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

61:                                               ; preds = %44
  %62 = extractelement <2 x double> %27, i64 1
  %63 = fneg double %62
  %64 = fdiv double %63, %29
  %65 = call noundef double @_ZN9Collision6_clampEddd(double noundef %64, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

66:                                               ; preds = %42
  br i1 %43, label %67, label %72

67:                                               ; preds = %66
  %68 = extractelement <2 x double> %27, i64 0
  %69 = fneg double %68
  %70 = fdiv double %69, %28
  %71 = call noundef double @_ZN9Collision6_clampEddd(double noundef %70, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

72:                                               ; preds = %66
  %73 = fdiv double 1.000000e+00, %30
  %74 = fmul double %73, %38
  %75 = fmul double %73, %37
  br label %127

76:                                               ; preds = %13
  br i1 %41, label %77, label %94

77:                                               ; preds = %76
  %78 = extractelement <2 x double> %27, i64 0
  %79 = fadd double %78, %16
  %80 = extractelement <2 x double> %27, i64 1
  %81 = fadd double %29, %80
  %82 = fcmp ogt double %81, %79
  br i1 %82, label %83, label %90

83:                                               ; preds = %77
  %84 = fsub double %81, %79
  %85 = call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double %28)
  %86 = fadd double %85, %29
  %87 = fdiv double %84, %86
  %88 = call noundef double @_ZN9Collision6_clampEddd(double noundef %87, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %89 = fsub double 1.000000e+00, %88
  br label %127

90:                                               ; preds = %77
  %91 = fneg double %80
  %92 = fdiv double %91, %29
  %93 = call noundef double @_ZN9Collision6_clampEddd(double noundef %92, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

94:                                               ; preds = %76
  %95 = fcmp olt double %37, 0.000000e+00
  br i1 %95, label %96, label %116

96:                                               ; preds = %94
  %97 = fadd <2 x double> %24, %27
  %98 = extractelement <2 x double> %97, i64 0
  %99 = extractelement <2 x double> %27, i64 1
  %100 = fadd double %99, %16
  %101 = fcmp ogt double %98, %100
  br i1 %101, label %102, label %112

102:                                              ; preds = %96
  %103 = extractelement <2 x double> %27, i64 0
  %104 = fadd double %29, %99
  %105 = fsub double %104, %16
  %106 = fsub double %105, %103
  %107 = call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double %28)
  %108 = fadd double %107, %29
  %109 = fdiv double %106, %108
  %110 = call noundef double @_ZN9Collision6_clampEddd(double noundef %109, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %111 = fsub double 1.000000e+00, %110
  br label %127

112:                                              ; preds = %96
  %113 = fneg double %99
  %114 = fdiv double %113, %29
  %115 = call noundef double @_ZN9Collision6_clampEddd(double noundef %114, double noundef 0.000000e+00, double noundef 1.000000e+00)
  br label %127

116:                                              ; preds = %94
  %117 = fadd <2 x double> %24, %27
  %118 = extractelement <2 x double> %117, i64 1
  %119 = fsub double %118, %16
  %120 = extractelement <2 x double> %27, i64 0
  %121 = fsub double %119, %120
  %122 = call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double %28)
  %123 = fadd double %122, %29
  %124 = fdiv double %121, %123
  %125 = call noundef double @_ZN9Collision6_clampEddd(double noundef %124, double noundef 0.000000e+00, double noundef 1.000000e+00)
  %126 = fsub double 1.000000e+00, %125
  br label %127

127:                                              ; preds = %83, %90, %102, %112, %116, %47, %56, %61, %72, %67
  %.187 = phi double [ 0.000000e+00, %47 ], [ %60, %56 ], [ %65, %61 ], [ 0.000000e+00, %67 ], [ %75, %72 ], [ %111, %102 ], [ 0.000000e+00, %112 ], [ %126, %116 ], [ %89, %83 ], [ %93, %90 ]
  %.185 = phi double [ %51, %47 ], [ 0.000000e+00, %56 ], [ 0.000000e+00, %61 ], [ %71, %67 ], [ %74, %72 ], [ %110, %102 ], [ %115, %112 ], [ %125, %116 ], [ %88, %83 ], [ 0.000000e+00, %90 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  %128 = fptrunc double %.185 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %10, float noundef %128, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %129 unwind label %134

129:                                              ; preds = %127
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %130 unwind label %136

130:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  %131 = fptrunc double %.187 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %11, float noundef %131, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %132 unwind label %138

132:                                              ; preds = %130
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %133 unwind label %140

133:                                              ; preds = %132
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  ret void

134:                                              ; preds = %127
  %135 = landingpad { ptr, i32 }
          cleanup
  br label %144

136:                                              ; preds = %129
  %137 = landingpad { ptr, i32 }
          cleanup
  br label %143

138:                                              ; preds = %130
  %139 = landingpad { ptr, i32 }
          cleanup
  br label %142

140:                                              ; preds = %132
  %141 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #8
  br label %142

142:                                              ; preds = %140, %138
  %.pn = phi { ptr, i32 } [ %141, %140 ], [ %139, %138 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  br label %143

143:                                              ; preds = %142, %136
  %.pn.pn = phi { ptr, i32 } [ %.pn, %142 ], [ %137, %136 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #8
  br label %144

144:                                              ; preds = %143, %134
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %143 ], [ %135, %134 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  br label %145

145:                                              ; preds = %144, %54
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %144 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  br label %146

146:                                              ; preds = %145, %52
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %145 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN9Collision6_clampEddd(double noundef, double noundef, double noundef) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass