; LLVM IR from doyubkim/fluid-engine-dev :: src/jet/cylinder3.ll (ZNK3jet9Cylinder315intersectsLocalERKNS_3RayIdLm3EEE)

; 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.jet::Vector" = type { double, double, double }
%"class.jet::BoundingBox.1" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Plane3" = type { %"class.jet::Surface3.base", %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Surface3.base" = type <{ ptr, %"class.jet::Transform3", i8 }>
%"class.jet::Transform3" = type { %"class.jet::Vector", %"class.jet::Quaternion", %"class.jet::Matrix", %"class.jet::Matrix" }
%"class.jet::Quaternion" = type { double, double, double, double }
%"class.jet::Matrix" = type { %"struct.std::array" }
%"struct.std::array" = type { [9 x double] }
%"struct.jet::SurfaceRayIntersection3" = type { i8, double, %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Vector.0" = type { double, double }
%"class.jet::Ray" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Cylinder3" = type { %"class.jet::Surface3.base", %"class.jet::Vector", double, double }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 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 nounwind uwtable
declare dso_local void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3jet9Cylinder315intersectsLocalERKNS_3RayIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.jet::Vector", align 8
  %7 = alloca %"class.jet::Vector", align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %"class.jet::BoundingBox.1", align 8
  %12 = alloca %"class.jet::Plane3", align 8
  %13 = alloca %"class.jet::Vector", align 8
  %14 = alloca %"class.jet::Transform3", align 8
  %15 = alloca %"class.jet::Plane3", align 8
  %16 = alloca %"class.jet::Vector", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.jet::Transform3", align 8
  %20 = alloca %"struct.jet::SurfaceRayIntersection3", align 8
  %21 = alloca %"struct.jet::SurfaceRayIntersection3", align 8
  %22 = alloca %"class.jet::Vector", align 8
  %23 = alloca %"class.jet::Vector.0", align 8
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca %"class.jet::Vector", align 8
  %29 = alloca %"class.jet::Vector", align 8
  %30 = alloca %"class.jet::Vector", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.jet::Ray", ptr %32, i32 0, i32 1
  call void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %33)
  %34 = getelementptr inbounds %"class.jet::Vector", ptr %6, i32 0, i32 1
  store double 0.000000e+00, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #8
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.jet::Ray", ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %37)
  %38 = getelementptr inbounds %"class.jet::Vector", ptr %7, i32 0, i32 1
  store double 0.000000e+00, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %39 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  store double %39, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %40 = call noundef double @_ZNK3jet6VectorIdLm3EE3dotERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  store double %40, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %41 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %42 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 2
  %43 = load double, ptr %42, align 8, !tbaa !13
  %44 = call noundef double @_ZN3jet6squareIdEET_S1_(double noundef %43)
  %45 = fsub double %41, %44
  store double %45, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #8
  call void @_ZNK3jet8Surface311boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox.1") align 8 %11, ptr noundef nonnull align 8 dereferenceable(209) %31)
  call void @llvm.lifetime.start.p0(i64 264, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #8
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %13, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
  %46 = getelementptr inbounds %"class.jet::BoundingBox.1", ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 200, ptr %14) #8
  call void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200) %14)
  call void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(200) %14, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 200, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 264, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #8
  invoke void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %16, double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
          to label %47 unwind label %92

47:                                               ; preds = %2
  %48 = getelementptr inbounds %"class.jet::BoundingBox.1", ptr %11, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 200, ptr %19) #8
  invoke void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200) %19)
          to label %49 unwind label %96

49:                                               ; preds = %47
  invoke void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(200) %19, i1 noundef zeroext false)
          to label %50 unwind label %96

50:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 200, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr %20) #8
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.jet::SurfaceRayIntersection3") align 8 %20, ptr noundef nonnull align 8 dereferenceable(209) %12, ptr noundef nonnull align 8 dereferenceable(48) %51)
          to label %52 unwind label %101

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 64, ptr %21) #8
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.jet::SurfaceRayIntersection3") align 8 %21, ptr noundef nonnull align 8 dereferenceable(209) %15, ptr noundef nonnull align 8 dereferenceable(48) %53)
          to label %54 unwind label %105

54:                                               ; preds = %52
  %55 = load double, ptr %8, align 8, !tbaa !12
  %56 = fcmp olt double %55, 0x3CB0000000000000
  br i1 %56, label %66, label %57

57:                                               ; preds = %54
  %58 = load double, ptr %9, align 8, !tbaa !12
  %59 = load double, ptr %9, align 8, !tbaa !12
  %60 = load double, ptr %8, align 8, !tbaa !12
  %61 = load double, ptr %10, align 8, !tbaa !12
  %62 = fmul double %60, %61
  %63 = fneg double %62
  %64 = call double @llvm.fmuladd.f64(double %58, double %59, double %63)
  %65 = fcmp olt double %64, 0.000000e+00
  br i1 %65, label %66, label %121

66:                                               ; preds = %57, %54
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #8
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %"class.jet::Ray", ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(24) %69)
          to label %70 unwind label %109

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  %71 = getelementptr inbounds %"class.jet::Vector", ptr %22, i32 0, i32 0
  %72 = load double, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds %"class.jet::Vector", ptr %22, i32 0, i32 2
  %74 = load double, ptr %73, align 8, !tbaa !22
  invoke void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %23, double noundef %72, double noundef %74)
          to label %75 unwind label %113

75:                                               ; preds = %70
  %76 = invoke noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %77 unwind label %113

77:                                               ; preds = %75
  %78 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 2
  %79 = load double, ptr %78, align 8, !tbaa !13
  %80 = invoke noundef double @_ZN3jet6squareIdEET_S1_(double noundef %79)
          to label %81 unwind label %113

81:                                               ; preds = %77
  %82 = fcmp ole double %76, %80
  br i1 %82, label %83, label %118

83:                                               ; preds = %81
  %84 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %20, i32 0, i32 0
  %85 = load i8, ptr %84, align 8, !tbaa !23, !range !25, !noundef !26
  %86 = trunc i8 %85 to i1
  br i1 %86, label %91, label %87

87:                                               ; preds = %83
  %88 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %21, i32 0, i32 0
  %89 = load i8, ptr %88, align 8, !tbaa !23, !range !25, !noundef !26
  %90 = trunc i8 %89 to i1
  br i1 %90, label %91, label %117

91:                                               ; preds = %87, %83
  store i1 true, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %119

92:                                               ; preds = %2
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %17, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %18, align 4
  br label %100

96:                                               ; preds = %49, %47
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %17, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 200, ptr %19) #8
  br label %100

100:                                              ; preds = %96, %92
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  br label %238

101:                                              ; preds = %50
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %17, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %18, align 4
  br label %237

105:                                              ; preds = %52
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %17, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %18, align 4
  br label %236

109:                                              ; preds = %66
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %17, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %18, align 4
  br label %120

113:                                              ; preds = %77, %75, %70
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %17, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  br label %120

117:                                              ; preds = %87
  br label %118

118:                                              ; preds = %117, %81
  store i1 false, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %119

119:                                              ; preds = %118, %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #8
  br label %234

120:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #8
  br label %236

121:                                              ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %122 = load double, ptr %9, align 8, !tbaa !12
  %123 = fneg double %122
  %124 = load double, ptr %9, align 8, !tbaa !12
  %125 = load double, ptr %9, align 8, !tbaa !12
  %126 = load double, ptr %8, align 8, !tbaa !12
  %127 = load double, ptr %10, align 8, !tbaa !12
  %128 = fmul double %126, %127
  %129 = fneg double %128
  %130 = call double @llvm.fmuladd.f64(double %124, double %125, double %129)
  %131 = call double @sqrt(double noundef %130) #8
  %132 = fadd double %123, %131
  %133 = load double, ptr %8, align 8, !tbaa !12
  %134 = fdiv double %132, %133
  store double %134, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %135 = load double, ptr %9, align 8, !tbaa !12
  %136 = fneg double %135
  %137 = load double, ptr %9, align 8, !tbaa !12
  %138 = load double, ptr %9, align 8, !tbaa !12
  %139 = load double, ptr %8, align 8, !tbaa !12
  %140 = load double, ptr %10, align 8, !tbaa !12
  %141 = fmul double %139, %140
  %142 = fneg double %141
  %143 = call double @llvm.fmuladd.f64(double %137, double %138, double %142)
  %144 = call double @sqrt(double noundef %143) #8
  %145 = fsub double %136, %144
  %146 = load double, ptr %8, align 8, !tbaa !12
  %147 = fdiv double %145, %146
  store double %147, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %148 = load double, ptr %26, align 8, !tbaa !12
  store double %148, ptr %27, align 8, !tbaa !12
  %149 = load double, ptr %26, align 8, !tbaa !12
  %150 = fcmp olt double %149, 0.000000e+00
  br i1 %150, label %151, label %153

151:                                              ; preds = %121
  %152 = load double, ptr %25, align 8, !tbaa !12
  store double %152, ptr %27, align 8, !tbaa !12
  br label %153

153:                                              ; preds = %151, %121
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #8
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = load double, ptr %27, align 8, !tbaa !12
  invoke void @_ZNK3jet3RayIdLm3EE7pointAtEd(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %28, ptr noundef nonnull align 8 dereferenceable(48) %154, double noundef %155)
          to label %156 unwind label %177

156:                                              ; preds = %153
  %157 = getelementptr inbounds %"class.jet::Vector", ptr %28, i32 0, i32 1
  %158 = load double, ptr %157, align 8, !tbaa !9
  %159 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  %160 = getelementptr inbounds %"class.jet::Vector", ptr %159, i32 0, i32 1
  %161 = load double, ptr %160, align 8, !tbaa !27
  %162 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 3
  %163 = load double, ptr %162, align 8, !tbaa !28
  %164 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %163, double %161)
  %165 = fcmp oge double %158, %164
  br i1 %165, label %166, label %181

166:                                              ; preds = %156
  %167 = getelementptr inbounds %"class.jet::Vector", ptr %28, i32 0, i32 1
  %168 = load double, ptr %167, align 8, !tbaa !9
  %169 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  %170 = getelementptr inbounds %"class.jet::Vector", ptr %169, i32 0, i32 1
  %171 = load double, ptr %170, align 8, !tbaa !27
  %172 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 3
  %173 = load double, ptr %172, align 8, !tbaa !28
  %174 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %173, double %171)
  %175 = fcmp ole double %168, %174
  br i1 %175, label %176, label %181

176:                                              ; preds = %166
  store i1 true, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %232

177:                                              ; preds = %153
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %17, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %18, align 4
  br label %233

181:                                              ; preds = %166, %156
  %182 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %20, i32 0, i32 0
  %183 = load i8, ptr %182, align 8, !tbaa !23, !range !25, !noundef !26
  %184 = trunc i8 %183 to i1
  br i1 %184, label %185, label %206

185:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #8
  %186 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %20, i32 0, i32 2
  %187 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %29, ptr noundef nonnull align 8 dereferenceable(24) %186, ptr noundef nonnull align 8 dereferenceable(24) %187)
          to label %188 unwind label %198

188:                                              ; preds = %185
  %189 = getelementptr inbounds %"class.jet::Vector", ptr %29, i32 0, i32 1
  store double 0.000000e+00, ptr %189, align 8, !tbaa !9
  %190 = invoke noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %191 unwind label %198

191:                                              ; preds = %188
  %192 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 2
  %193 = load double, ptr %192, align 8, !tbaa !13
  %194 = invoke noundef double @_ZN3jet6squareIdEET_S1_(double noundef %193)
          to label %195 unwind label %198

195:                                              ; preds = %191
  %196 = fcmp ole double %190, %194
  br i1 %196, label %197, label %202

197:                                              ; preds = %195
  store i1 true, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %203

198:                                              ; preds = %191, %188, %185
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %17, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  br label %233

202:                                              ; preds = %195
  store i32 0, ptr %24, align 4
  br label %203

203:                                              ; preds = %202, %197
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  %204 = load i32, ptr %24, align 4
  switch i32 %204, label %232 [
    i32 0, label %205
  ]

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205, %181
  %207 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %21, i32 0, i32 0
  %208 = load i8, ptr %207, align 8, !tbaa !23, !range !25, !noundef !26
  %209 = trunc i8 %208 to i1
  br i1 %209, label %210, label %231

210:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #8
  %211 = getelementptr inbounds %"struct.jet::SurfaceRayIntersection3", ptr %21, i32 0, i32 2
  %212 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 1
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %211, ptr noundef nonnull align 8 dereferenceable(24) %212)
          to label %213 unwind label %223

213:                                              ; preds = %210
  %214 = getelementptr inbounds %"class.jet::Vector", ptr %30, i32 0, i32 1
  store double 0.000000e+00, ptr %214, align 8, !tbaa !9
  %215 = invoke noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %216 unwind label %223

216:                                              ; preds = %213
  %217 = getelementptr inbounds %"class.jet::Cylinder3", ptr %31, i32 0, i32 2
  %218 = load double, ptr %217, align 8, !tbaa !13
  %219 = invoke noundef double @_ZN3jet6squareIdEET_S1_(double noundef %218)
          to label %220 unwind label %223

220:                                              ; preds = %216
  %221 = fcmp ole double %215, %219
  br i1 %221, label %222, label %227

222:                                              ; preds = %220
  store i1 true, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %228

223:                                              ; preds = %216, %213, %210
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %17, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  br label %233

227:                                              ; preds = %220
  store i32 0, ptr %24, align 4
  br label %228

228:                                              ; preds = %227, %222
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  %229 = load i32, ptr %24, align 4
  switch i32 %229, label %232 [
    i32 0, label %230
  ]

230:                                              ; preds = %228
  br label %231

231:                                              ; preds = %230, %206
  store i1 false, ptr %3, align 1
  store i32 1, ptr %24, align 4
  br label %232

232:                                              ; preds = %231, %228, %203, %176
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %234

233:                                              ; preds = %223, %198, %177
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %236

234:                                              ; preds = %232, %119
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #8
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %15) #8
  call void @llvm.lifetime.end.p0(i64 264, ptr %15) #8
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %12) #8
  call void @llvm.lifetime.end.p0(i64 264, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  %235 = load i1, ptr %3, align 1
  ret i1 %235

236:                                              ; preds = %233, %120, %105
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #8
  br label %237

237:                                              ; preds = %236, %101
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #8
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %15) #8
  br label %238

238:                                              ; preds = %237, %100
  call void @llvm.lifetime.end.p0(i64 264, ptr %15) #8
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %12) #8
  call void @llvm.lifetime.end.p0(i64 264, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  br label %239

239:                                              ; preds = %238
  %240 = load ptr, ptr %17, align 8
  %241 = load i32, ptr %18, align 4
  %242 = insertvalue { ptr, i32 } poison, ptr %240, 0
  %243 = insertvalue { ptr, i32 } %242, i32 %241, 1
  resume { ptr, i32 } %243
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm3EE3dotERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

declare void @_ZNK3jet8Surface311boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox.1") align 8, ptr noundef nonnull align 8 dereferenceable(209)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #7 align 2

declare void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(200), i1 noundef zeroext) unnamed_addr #6

declare void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.jet::SurfaceRayIntersection3") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(48)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet3RayIdLm3EE7pointAtEd(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(48), double noundef) #2 align 2

; Function Attrs: nounwind
declare void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(209)) unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN3jet6VectorIdLm3EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !11, i64 240}
!14 = !{!"_ZTSN3jet9Cylinder3E", !15, i64 0, !10, i64 216, !11, i64 240, !11, i64 248}
!15 = !{!"_ZTSN3jet8Surface3E", !16, i64 8, !20, i64 208}
!16 = !{!"_ZTSN3jet10Transform3E", !10, i64 0, !17, i64 24, !18, i64 56, !18, i64 128}
!17 = !{!"_ZTSN3jet10QuaternionIdEE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!18 = !{!"_ZTSN3jet6MatrixIdLm3ELm3EEE", !19, i64 0}
!19 = !{!"_ZTSSt5arrayIdLm9EE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!10, !11, i64 0}
!22 = !{!10, !11, i64 16}
!23 = !{!24, !20, i64 0}
!24 = !{!"_ZTSN3jet23SurfaceRayIntersection3E", !20, i64 0, !11, i64 8, !10, i64 16, !10, i64 40}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!14, !11, i64 224}
!28 = !{!14, !11, i64 248}


; 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.jet::Vector" = type { double, double, double }
%"class.jet::BoundingBox.1" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Plane3" = type { %"class.jet::Surface3.base", %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Surface3.base" = type <{ ptr, %"class.jet::Transform3", i8 }>
%"class.jet::Transform3" = type { %"class.jet::Vector", %"class.jet::Quaternion", %"class.jet::Matrix", %"class.jet::Matrix" }
%"class.jet::Quaternion" = type { double, double, double, double }
%"class.jet::Matrix" = type { %"struct.std::array" }
%"struct.std::array" = type { [9 x double] }
%"struct.jet::SurfaceRayIntersection3" = type { i8, double, %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Vector.0" = type { double, double }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; 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 uwtable
declare dso_local void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 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
declare dso_local void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3jet9Cylinder315intersectsLocalERKNS_3RayIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.jet::Vector", align 8
  %4 = alloca %"class.jet::Vector", align 8
  %5 = alloca %"class.jet::BoundingBox.1", align 8
  %6 = alloca %"class.jet::Plane3", align 8
  %7 = alloca %"class.jet::Vector", align 8
  %8 = alloca %"class.jet::Transform3", align 8
  %9 = alloca %"class.jet::Plane3", align 8
  %10 = alloca %"class.jet::Vector", align 8
  %11 = alloca %"class.jet::Transform3", align 8
  %12 = alloca %"struct.jet::SurfaceRayIntersection3", align 8
  %13 = alloca %"struct.jet::SurfaceRayIntersection3", align 8
  %14 = alloca %"class.jet::Vector", align 8
  %15 = alloca %"class.jet::Vector.0", align 8
  %16 = alloca %"class.jet::Vector", align 8
  %17 = alloca %"class.jet::Vector", align 8
  %18 = alloca %"class.jet::Vector", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #9
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  call void @_ZN3jet6VectorIdLm3EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  store double 0.000000e+00, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #9
  %21 = getelementptr inbounds i8, ptr %0, i64 216
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %21)
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  store double 0.000000e+00, ptr %22, align 8, !tbaa !5
  %23 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %24 = call noundef double @_ZNK3jet6VectorIdLm3EE3dotERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %25 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %26 = getelementptr inbounds i8, ptr %0, i64 240
  %27 = load double, ptr %26, align 8, !tbaa !10
  %28 = call noundef double @_ZN3jet6squareIdEET_S1_(double noundef %27)
  %29 = fsub double %25, %28
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #9
  call void @_ZNK3jet8Surface311boundingBoxEv(ptr dead_on_unwind nonnull writable sret(%"class.jet::BoundingBox.1") align 8 %5, ptr noundef nonnull align 8 dereferenceable(209) %0)
  call void @llvm.lifetime.start.p0(i64 264, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #9
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef 0.000000e+00, double noundef 1.000000e+00, double noundef 0.000000e+00)
  %30 = getelementptr inbounds i8, ptr %5, i64 24
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %8) #9
  call void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200) %8)
  call void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(200) %8, i1 noundef zeroext false)
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 264, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #9
  call void @_ZN3jet6VectorIdLm3EEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef 0.000000e+00, double noundef -1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %11) #9
  invoke void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200) %11)
          to label %31 unwind label %56

31:                                               ; preds = %2
  invoke void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(200) %11, i1 noundef zeroext false)
          to label %32 unwind label %56

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #9
  invoke void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"struct.jet::SurfaceRayIntersection3") align 8 %12, ptr noundef nonnull align 8 dereferenceable(209) %6, ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %33 unwind label %58

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #9
  invoke void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"struct.jet::SurfaceRayIntersection3") align 8 %13, ptr noundef nonnull align 8 dereferenceable(209) %9, ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %34 unwind label %60

34:                                               ; preds = %33
  %35 = fcmp olt double %23, 0x3CB0000000000000
  br i1 %35, label %41, label %36

36:                                               ; preds = %34
  %37 = fneg double %23
  %38 = fmul double %29, %37
  %39 = call double @llvm.fmuladd.f64(double %24, double %24, double %38)
  %40 = fcmp olt double %39, 0.000000e+00
  br i1 %40, label %41, label %66

41:                                               ; preds = %36, %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %42 unwind label %62

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #9
  %43 = load double, ptr %14, align 8, !tbaa !18
  %44 = getelementptr inbounds i8, ptr %14, i64 16
  %45 = load double, ptr %44, align 8, !tbaa !19
  call void @_ZN3jet6VectorIdLm2EEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef %43, double noundef %45)
  %46 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %47 = load double, ptr %26, align 8, !tbaa !10
  %48 = call noundef double @_ZN3jet6squareIdEET_S1_(double noundef %47)
  %49 = fcmp ugt double %46, %48
  br i1 %49, label %64, label %50

50:                                               ; preds = %42
  %51 = load i8, ptr %12, align 8, !tbaa !20, !range !22, !noundef !23
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %65, label %53

53:                                               ; preds = %50
  %54 = load i8, ptr %13, align 8, !tbaa !20, !range !22, !noundef !23
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %65, label %64

56:                                               ; preds = %31, %2
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  br label %120

58:                                               ; preds = %32
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %119

60:                                               ; preds = %33
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %118

62:                                               ; preds = %41
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  br label %118

64:                                               ; preds = %53, %42
  br label %65

65:                                               ; preds = %50, %53, %64
  %.033 = phi i1 [ false, %64 ], [ true, %53 ], [ true, %50 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  br label %117

66:                                               ; preds = %36
  %67 = fneg double %24
  %68 = call double @sqrt(double noundef %39) #9
  %69 = call double @sqrt(double noundef %39) #9
  %70 = fsub double %67, %69
  %71 = fdiv double %70, %23
  %72 = fcmp olt double %71, 0.000000e+00
  %73 = fsub double %68, %24
  %74 = fdiv double %73, %23
  %.0 = select i1 %72, double %74, double %71
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #9
  invoke void @_ZNK3jet3RayIdLm3EE7pointAtEd(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(48) %1, double noundef %.0)
          to label %75 unwind label %86

75:                                               ; preds = %66
  %76 = getelementptr inbounds i8, ptr %16, i64 8
  %77 = load double, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %0, i64 224
  %79 = load double, ptr %78, align 8, !tbaa !24
  %80 = getelementptr inbounds i8, ptr %0, i64 248
  %81 = load double, ptr %80, align 8, !tbaa !25
  %82 = call double @llvm.fmuladd.f64(double %81, double -5.000000e-01, double %79)
  %83 = fcmp ult double %77, %82
  %84 = call double @llvm.fmuladd.f64(double %81, double 5.000000e-01, double %79)
  %85 = fcmp ugt double %77, %84
  %or.cond = select i1 %83, i1 true, i1 %85
  br i1 %or.cond, label %88, label %115

86:                                               ; preds = %66
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %116

88:                                               ; preds = %75
  %89 = load i8, ptr %12, align 8, !tbaa !20, !range !22, !noundef !23
  %90 = trunc nuw i8 %89 to i1
  br i1 %90, label %91, label %101

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #9
  %92 = getelementptr inbounds i8, ptr %12, i64 16
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %93 unwind label %99

93:                                               ; preds = %91
  %94 = getelementptr inbounds i8, ptr %17, i64 8
  store double 0.000000e+00, ptr %94, align 8, !tbaa !5
  %95 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %96 = load double, ptr %26, align 8, !tbaa !10
  %97 = call noundef double @_ZN3jet6squareIdEET_S1_(double noundef %96)
  %98 = fcmp ugt double %95, %97
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #9
  br i1 %98, label %101, label %115

99:                                               ; preds = %91
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #9
  br label %116

101:                                              ; preds = %93, %88
  %102 = load i8, ptr %13, align 8, !tbaa !20, !range !22, !noundef !23
  %103 = trunc nuw i8 %102 to i1
  br i1 %103, label %104, label %114

104:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #9
  %105 = getelementptr inbounds i8, ptr %13, i64 16
  invoke void @_ZN3jetmiIdEENS_6VectorIT_Lm3EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %106 unwind label %112

106:                                              ; preds = %104
  %107 = getelementptr inbounds i8, ptr %18, i64 8
  store double 0.000000e+00, ptr %107, align 8, !tbaa !5
  %108 = call noundef double @_ZNK3jet6VectorIdLm3EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %109 = load double, ptr %26, align 8, !tbaa !10
  %110 = call noundef double @_ZN3jet6squareIdEET_S1_(double noundef %109)
  %111 = fcmp ugt double %108, %110
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  br i1 %111, label %114, label %115

112:                                              ; preds = %104
  %113 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  br label %116

114:                                              ; preds = %106, %101
  br label %115

115:                                              ; preds = %75, %93, %106, %114
  %.4 = phi i1 [ false, %114 ], [ true, %106 ], [ true, %93 ], [ true, %75 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #9
  br label %117

116:                                              ; preds = %112, %99, %86
  %.pn = phi { ptr, i32 } [ %113, %112 ], [ %100, %99 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #9
  br label %118

117:                                              ; preds = %115, %65
  %.5 = phi i1 [ %.033, %65 ], [ %.4, %115 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #9
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %9) #9
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %9) #9
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %6) #9
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  ret i1 %.5

118:                                              ; preds = %116, %62, %60
  %.pn49 = phi { ptr, i32 } [ %63, %62 ], [ %.pn, %116 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #9
  br label %119

119:                                              ; preds = %118, %58
  %.pn49.pn = phi { ptr, i32 } [ %.pn49, %118 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #9
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %9) #9
  br label %120

120:                                              ; preds = %119, %56
  %.pn49.pn.pn = phi { ptr, i32 } [ %.pn49.pn, %119 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %9) #9
  call void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(264) %6) #9
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn49.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm3EE3dotERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

declare void @_ZNK3jet8Surface311boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox.1") align 8, ptr noundef nonnull align 8 dereferenceable(209)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3jet10Transform3C2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #7 align 2

declare void @_ZN3jet6Plane3C1ERKNS_6VectorIdLm3EEES4_RKNS_10Transform3Eb(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(200), i1 noundef zeroext) unnamed_addr #6

declare void @_ZNK3jet8Surface319closestIntersectionERKNS_3RayIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.jet::SurfaceRayIntersection3") align 8, ptr noundef nonnull align 8 dereferenceable(209), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet3RayIdLm3EE7pointAtEd(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(48), double noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN3jet8Surface3D2Ev(ptr noundef nonnull align 8 dereferenceable(209)) unnamed_addr #8

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN3jet6VectorIdLm3EEE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 240}
!11 = !{!"_ZTSN3jet9Cylinder3E", !12, i64 0, !6, i64 216, !7, i64 240, !7, i64 248}
!12 = !{!"_ZTSN3jet8Surface3E", !13, i64 8, !17, i64 208}
!13 = !{!"_ZTSN3jet10Transform3E", !6, i64 0, !14, i64 24, !15, i64 56, !15, i64 128}
!14 = !{!"_ZTSN3jet10QuaternionIdEE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!15 = !{!"_ZTSN3jet6MatrixIdLm3ELm3EEE", !16, i64 0}
!16 = !{!"_ZTSSt5arrayIdLm9EE", !8, i64 0}
!17 = !{!"bool", !8, i64 0}
!18 = !{!6, !7, i64 0}
!19 = !{!6, !7, i64 16}
!20 = !{!21, !17, i64 0}
!21 = !{!"_ZTSN3jet23SurfaceRayIntersection3E", !17, i64 0, !7, i64 8, !6, i64 16, !6, i64 40}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!11, !7, i64 224}
!25 = !{!11, !7, i64 248}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass