; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Isect.ll (Z12R2IntersectsRK5R2RayRK5R2BoxP7R2PointP8R2VectorPd)

; 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.R2Vector = type { [2 x double] }
%class.R2Point = type { [2 x double] }

@RN_EPSILON = external global double, align 8
@R2null_vector = external global %class.R2Vector, align 8

declare noundef i32 @_Z10R2ContainsRK5R2BoxRK7R2Point(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R2IntersectsRK5R2RayRK5R2BoxP7R2PointP8R2VectorPd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #5 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.R2Point, align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.R2Vector, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK5R2Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(40) %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

25:                                               ; preds = %5
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %27)
  %29 = call noundef i32 @_Z10R2ContainsRK5R2BoxRK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %26, ptr noundef nonnull align 8 dereferenceable(16) %28)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %53

31:                                               ; preds = %25
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %39

34:                                               ; preds = %31
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %35)
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(16) %36)
  br label %39

39:                                               ; preds = %34, %31
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %47

42:                                               ; preds = %39
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %43)
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(16) %44)
  br label %47

47:                                               ; preds = %42, %39
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  store double 0.000000e+00, ptr %51, align 8, !tbaa !11
  br label %52

52:                                               ; preds = %50, %47
  store i32 4, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

53:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %218, %53
  %55 = load i32, ptr %16, align 4, !tbaa !9
  %56 = icmp sle i32 %55, 1
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 2, ptr %15, align 4
  br label %221

58:                                               ; preds = %54
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %59)
  %61 = load i32, ptr %16, align 4, !tbaa !9
  %62 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %60, i32 noundef %61)
  %63 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %64 = call noundef i32 @_Z12RNIsPositivedd(double noundef %62, double noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %89

66:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %67)
  %69 = load i32, ptr %16, align 4, !tbaa !9
  %70 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %68, i32 noundef %69)
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %71)
  %73 = load i32, ptr %16, align 4, !tbaa !9
  %74 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %72, i32 noundef %73)
  %75 = fsub double %70, %74
  store double %75, ptr %17, align 8, !tbaa !11
  %76 = load double, ptr %17, align 8, !tbaa !11
  %77 = fcmp olt double %76, 0.000000e+00
  br i1 %77, label %78, label %79

78:                                               ; preds = %66
  store i32 4, ptr %15, align 4
  br label %86

79:                                               ; preds = %66
  %80 = load double, ptr %17, align 8, !tbaa !11
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %81)
  %83 = load i32, ptr %16, align 4, !tbaa !9
  %84 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %82, i32 noundef %83)
  %85 = fdiv double %80, %84
  store double %85, ptr %14, align 8, !tbaa !11
  store i32 0, ptr %15, align 4
  br label %86

86:                                               ; preds = %79, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %87 = load i32, ptr %15, align 4
  switch i32 %87, label %226 [
    i32 0, label %88
    i32 4, label %218
  ]

88:                                               ; preds = %86
  br label %122

89:                                               ; preds = %58
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %90)
  %92 = load i32, ptr %16, align 4, !tbaa !9
  %93 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %91, i32 noundef %92)
  %94 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %95 = call noundef i32 @_Z12RNIsNegativedd(double noundef %93, double noundef %94)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %120

97:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %98)
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %99, i32 noundef %100)
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %102)
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %103, i32 noundef %104)
  %106 = fsub double %101, %105
  store double %106, ptr %18, align 8, !tbaa !11
  %107 = load double, ptr %18, align 8, !tbaa !11
  %108 = fcmp ogt double %107, 0.000000e+00
  br i1 %108, label %109, label %110

109:                                              ; preds = %97
  store i32 4, ptr %15, align 4
  br label %117

110:                                              ; preds = %97
  %111 = load double, ptr %18, align 8, !tbaa !11
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %112)
  %114 = load i32, ptr %16, align 4, !tbaa !9
  %115 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %113, i32 noundef %114)
  %116 = fdiv double %111, %115
  store double %116, ptr %14, align 8, !tbaa !11
  store i32 0, ptr %15, align 4
  br label %117

117:                                              ; preds = %110, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %118 = load i32, ptr %15, align 4
  switch i32 %118, label %226 [
    i32 0, label %119
    i32 4, label %218
  ]

119:                                              ; preds = %117
  br label %121

120:                                              ; preds = %89
  br label %218

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %123 = load i32, ptr %16, align 4, !tbaa !9
  %124 = sub nsw i32 1, %123
  store i32 %124, ptr %19, align 4, !tbaa !9
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %125)
  %127 = load i32, ptr %16, align 4, !tbaa !9
  %128 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %126, i32 noundef %127)
  %129 = fcmp ogt double %128, 0.000000e+00
  br i1 %129, label %130, label %135

130:                                              ; preds = %122
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %131)
  %133 = load i32, ptr %16, align 4, !tbaa !9
  %134 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %132, i32 noundef %133)
  br label %140

135:                                              ; preds = %122
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %136)
  %138 = load i32, ptr %16, align 4, !tbaa !9
  %139 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %137, i32 noundef %138)
  br label %140

140:                                              ; preds = %135, %130
  %141 = phi double [ %134, %130 ], [ %139, %135 ]
  %142 = load i32, ptr %16, align 4, !tbaa !9
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %142)
  store double %141, ptr %143, align 8, !tbaa !11
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %144)
  %146 = load i32, ptr %19, align 4, !tbaa !9
  %147 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %145, i32 noundef %146)
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %148)
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %149, i32 noundef %150)
  %152 = load double, ptr %14, align 8, !tbaa !11
  %153 = call double @llvm.fmuladd.f64(double %151, double %152, double %147)
  %154 = load i32, ptr %19, align 4, !tbaa !9
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %154)
  store double %153, ptr %155, align 8, !tbaa !11
  %156 = load i32, ptr %19, align 4, !tbaa !9
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %156)
  %158 = load double, ptr %157, align 8, !tbaa !11
  %159 = load ptr, ptr %8, align 8, !tbaa !5
  %160 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %159)
  %161 = load i32, ptr %19, align 4, !tbaa !9
  %162 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %160, i32 noundef %161)
  %163 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %164 = call noundef i32 @_Z15RNIsLessOrEqualddd(double noundef %158, double noundef %162, double noundef %163)
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %214

166:                                              ; preds = %140
  %167 = load i32, ptr %19, align 4, !tbaa !9
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %167)
  %169 = load double, ptr %168, align 8, !tbaa !11
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %170)
  %172 = load i32, ptr %19, align 4, !tbaa !9
  %173 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %171, i32 noundef %172)
  %174 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %175 = call noundef i32 @_Z18RNIsGreaterOrEqualddd(double noundef %169, double noundef %173, double noundef %174)
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %214

177:                                              ; preds = %166
  store i32 4, ptr %12, align 4, !tbaa !9
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = icmp ne ptr %178, null
  br i1 %179, label %180, label %183

180:                                              ; preds = %177
  %181 = load double, ptr %14, align 8, !tbaa !11
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  store double %181, ptr %182, align 8, !tbaa !11
  br label %183

183:                                              ; preds = %180, %177
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = icmp ne ptr %184, null
  br i1 %185, label %186, label %189

186:                                              ; preds = %183
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %187, ptr noundef nonnull align 8 dereferenceable(16) %13)
  br label %189

189:                                              ; preds = %186, %183
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  %191 = icmp ne ptr %190, null
  br i1 %191, label %192, label %213

192:                                              ; preds = %189
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %193, ptr noundef nonnull align 8 dereferenceable(16) @R2null_vector)
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %195)
  %197 = load i32, ptr %16, align 4, !tbaa !9
  %198 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %196, i32 noundef %197)
  %199 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %200 = call noundef i32 @_Z12RNIsNegativedd(double noundef %198, double noundef %199)
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %202, label %208

202:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = load i32, ptr %16, align 4, !tbaa !9
  %205 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %203, i32 noundef %204)
  store double 1.000000e+00, ptr %205, align 8, !tbaa !11
  call void @_ZN8R2VectorC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef 1.000000e+00)
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %206, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  br label %212

208:                                              ; preds = %192
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = load i32, ptr %16, align 4, !tbaa !9
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %209, i32 noundef %210)
  store double -1.000000e+00, ptr %211, align 8, !tbaa !11
  br label %212

212:                                              ; preds = %208, %202
  br label %213

213:                                              ; preds = %212, %189
  store i32 2, ptr %15, align 4
  br label %215

214:                                              ; preds = %166, %140
  store i32 0, ptr %15, align 4
  br label %215

215:                                              ; preds = %214, %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %216 = load i32, ptr %15, align 4
  switch i32 %216, label %221 [
    i32 0, label %217
  ]

217:                                              ; preds = %215
  br label %218

218:                                              ; preds = %217, %120, %117, %86
  %219 = load i32, ptr %16, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %16, align 4, !tbaa !9
  br label %54, !llvm.loop !13

221:                                              ; preds = %215, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %223, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

224:                                              ; preds = %222, %52, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %225 = load i32, ptr %6, align 4
  ret i32 %225

226:                                              ; preds = %117, %86
  unreachable
}

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5R2Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsNegativedd(double noundef, double noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z15RNIsLessOrEqualddd(double noundef, double noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsGreaterOrEqualddd(double noundef, double noundef, double noundef) #4

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

declare void @_ZN8R2VectorC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #0

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


; 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.R2Vector = type { [2 x double] }
%class.R2Point = type { [2 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8
@R2null_vector = external global %class.R2Vector, align 8

declare noundef i32 @_Z10R2ContainsRK5R2BoxRK7R2Point(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 5) i32 @_Z12R2IntersectsRK5R2RayRK5R2BoxP7R2PointP8R2VectorPd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2, ptr noundef %3, ptr noundef writeonly %4) local_unnamed_addr #5 {
  %6 = alloca %class.R2Point, align 8
  %7 = alloca %class.R2Vector, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %8 = call noundef i32 @_ZNK5R2Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %.thread109

9:                                                ; preds = %5
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %11 = call noundef i32 @_Z10R2ContainsRK5R2BoxRK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.not88 = icmp eq i32 %11, 0
  br i1 %.not88, label %.preheader.preheader, label %16

.preheader.preheader:                             ; preds = %9
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %13 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 0)
  %14 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %15 = call noundef i32 @_Z12RNIsPositivedd(double noundef %13, double noundef %14)
  %.not89 = icmp eq i32 %15, 0
  br i1 %.not89, label %33, label %26

16:                                               ; preds = %9
  %.not97 = icmp eq ptr %2, null
  br i1 %.not97, label %20, label %17

17:                                               ; preds = %16
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %18)
  br label %20

20:                                               ; preds = %17, %16
  %.not98 = icmp eq ptr %3, null
  br i1 %.not98, label %24, label %21

21:                                               ; preds = %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %22)
  br label %24

24:                                               ; preds = %21, %20
  %.not99 = icmp eq ptr %4, null
  br i1 %.not99, label %.thread109, label %25

25:                                               ; preds = %24
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  br label %.thread109

26:                                               ; preds = %.preheader.preheader
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %28 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %27, i32 noundef 0)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %30 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %29, i32 noundef 0)
  %31 = fsub double %28, %30
  %32 = fcmp olt double %31, 0.000000e+00
  br i1 %32, label %.preheader.1, label %.thread

33:                                               ; preds = %.preheader.preheader
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %35 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %34, i32 noundef 0)
  %36 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %37 = call noundef i32 @_Z12RNIsNegativedd(double noundef %35, double noundef %36)
  %.not90 = icmp eq i32 %37, 0
  br i1 %.not90, label %.preheader.1, label %38

38:                                               ; preds = %33
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %40 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %39, i32 noundef 0)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %42 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %41, i32 noundef 0)
  %43 = fsub double %40, %42
  %44 = fcmp ogt double %43, 0.000000e+00
  br i1 %44, label %.preheader.1, label %.thread

.thread:                                          ; preds = %38, %26
  %.sink = phi double [ %31, %26 ], [ %43, %38 ]
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %46 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %45, i32 noundef 0)
  %47 = fdiv double %.sink, %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %49 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %48, i32 noundef 0)
  %50 = fcmp ogt double %49, 0.000000e+00
  br i1 %50, label %51, label %53

51:                                               ; preds = %.thread
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br label %55

53:                                               ; preds = %.thread
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br label %55

55:                                               ; preds = %53, %51
  %.sink118 = phi ptr [ %54, %53 ], [ %52, %51 ]
  %56 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.sink118, i32 noundef 0)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 0)
  store double %56, ptr %57, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %59 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %58, i32 noundef 1)
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %61 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %60, i32 noundef 1)
  %62 = call double @llvm.fmuladd.f64(double %61, double %47, double %59)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 1)
  store double %62, ptr %63, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 1)
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %67 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %66, i32 noundef 1)
  %68 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %69 = call noundef i32 @_Z15RNIsLessOrEqualddd(double noundef %65, double noundef %67, double noundef %68)
  %.not91 = icmp eq i32 %69, 0
  br i1 %.not91, label %.preheader.1, label %70

70:                                               ; preds = %55
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 1)
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %74 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %73, i32 noundef 1)
  %75 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %76 = call noundef i32 @_Z18RNIsGreaterOrEqualddd(double noundef %72, double noundef %74, double noundef %75)
  %.not92 = icmp eq i32 %76, 0
  br i1 %.not92, label %.preheader.1, label %77

77:                                               ; preds = %142, %70
  %.076113.lcssa = phi i32 [ 0, %70 ], [ 1, %142 ]
  %.375.lcssa = phi double [ %47, %70 ], [ %119, %142 ]
  %.not93 = icmp eq ptr %4, null
  br i1 %.not93, label %79, label %78

78:                                               ; preds = %77
  store double %.375.lcssa, ptr %4, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %78, %77
  %.not94 = icmp eq ptr %2, null
  br i1 %.not94, label %82, label %80

80:                                               ; preds = %79
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %6)
  br label %82

82:                                               ; preds = %80, %79
  %.not95 = icmp eq ptr %3, null
  br i1 %.not95, label %.thread109, label %83

83:                                               ; preds = %82
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) @R2null_vector)
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %86 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %85, i32 noundef %.076113.lcssa)
  %87 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %88 = call noundef i32 @_Z12RNIsNegativedd(double noundef %86, double noundef %87)
  %.not96 = icmp eq i32 %88, 0
  br i1 %.not96, label %92, label %89

89:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.076113.lcssa)
  store double 1.000000e+00, ptr %90, align 8, !tbaa !5
  call void @_ZN8R2VectorC1Ed(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef 1.000000e+00)
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %.thread109

92:                                               ; preds = %83
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.076113.lcssa)
  store double -1.000000e+00, ptr %93, align 8, !tbaa !5
  br label %.thread109

.preheader.1:                                     ; preds = %70, %55, %38, %26, %33
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %95 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %94, i32 noundef 1)
  %96 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %97 = call noundef i32 @_Z12RNIsPositivedd(double noundef %95, double noundef %96)
  %.not89.1 = icmp eq i32 %97, 0
  br i1 %.not89.1, label %105, label %98

98:                                               ; preds = %.preheader.1
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %100 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %99, i32 noundef 1)
  %101 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %102 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %101, i32 noundef 1)
  %103 = fsub double %100, %102
  %104 = fcmp olt double %103, 0.000000e+00
  br i1 %104, label %.thread109, label %.thread.1

105:                                              ; preds = %.preheader.1
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %107 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %106, i32 noundef 1)
  %108 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %109 = call noundef i32 @_Z12RNIsNegativedd(double noundef %107, double noundef %108)
  %.not90.1 = icmp eq i32 %109, 0
  br i1 %.not90.1, label %.thread109, label %110

110:                                              ; preds = %105
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %112 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %111, i32 noundef 1)
  %113 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %114 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %113, i32 noundef 1)
  %115 = fsub double %112, %114
  %116 = fcmp ogt double %115, 0.000000e+00
  br i1 %116, label %.thread109, label %.thread.1

.thread.1:                                        ; preds = %110, %98
  %.sink119 = phi double [ %103, %98 ], [ %115, %110 ]
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %118 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %117, i32 noundef 1)
  %119 = fdiv double %.sink119, %118
  %120 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %121 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %120, i32 noundef 1)
  %122 = fcmp ogt double %121, 0.000000e+00
  br i1 %122, label %125, label %123

123:                                              ; preds = %.thread.1
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br label %127

125:                                              ; preds = %.thread.1
  %126 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br label %127

127:                                              ; preds = %125, %123
  %.sink122 = phi ptr [ %126, %125 ], [ %124, %123 ]
  %128 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.sink122, i32 noundef 1)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 1)
  store double %128, ptr %129, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %131 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %130, i32 noundef 0)
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %133 = call noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %132, i32 noundef 0)
  %134 = call double @llvm.fmuladd.f64(double %133, double %119, double %131)
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 0)
  store double %134, ptr %135, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 0)
  %137 = load double, ptr %136, align 8, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %139 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %138, i32 noundef 0)
  %140 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %141 = call noundef i32 @_Z15RNIsLessOrEqualddd(double noundef %137, double noundef %139, double noundef %140)
  %.not91.1 = icmp eq i32 %141, 0
  br i1 %.not91.1, label %.thread109, label %142

142:                                              ; preds = %127
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef 0)
  %144 = load double, ptr %143, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %146 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %145, i32 noundef 0)
  %147 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %148 = call noundef i32 @_Z18RNIsGreaterOrEqualddd(double noundef %144, double noundef %146, double noundef %147)
  %.not92.1 = icmp eq i32 %148, 0
  br i1 %.not92.1, label %.thread109, label %77

.thread109:                                       ; preds = %98, %105, %110, %127, %142, %82, %92, %89, %24, %25, %5
  %.0 = phi i32 [ 0, %5 ], [ 4, %25 ], [ 4, %24 ], [ 4, %89 ], [ 4, %92 ], [ 4, %82 ], [ 0, %142 ], [ 0, %127 ], [ 0, %110 ], [ 0, %105 ], [ 0, %98 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  ret i32 %.0
}

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5R2Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MinEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsNegativedd(double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Box3MaxEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z15RNIsLessOrEqualddd(double noundef, double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsGreaterOrEqualddd(double noundef, double noundef, double noundef) local_unnamed_addr #4

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

declare void @_ZN8R2VectorC1Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #0

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


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass