; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Isect.ll (Z12R3IntersectsRK10R3TriangleRK5R3Box)

; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #1

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK10R3Triangle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(132)) #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK7R3PlaneRK5R3Box(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(56)) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK10R3TriangleRK5R3Box(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(56) %1) #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %class.R3Box, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca [16 x %class.R3Point], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %class.R3Point, align 8
  %21 = alloca %class.R3Point, align 8
  %22 = alloca %class.R3Point, align 8
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca %class.R3Point, align 8
  %26 = alloca %class.R3Point, align 8
  %27 = alloca %class.R3Point, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 17
  %32 = load ptr, ptr %31, align 8
  call void %32(ptr dead_on_unwind writable sret(%class.R3Box) align 8 %6, ptr noundef nonnull align 8 dereferenceable(132) %29)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = invoke noundef i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull align 8 dereferenceable(56) %33, ptr noundef null)
          to label %35 unwind label %39

35:                                               ; preds = %2
  %36 = icmp ne i32 %34, 0
  %37 = xor i1 %36, true
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #6
  br i1 %37, label %38, label %43

38:                                               ; preds = %35
  store i32 0, ptr %3, align 4
  br label %269

39:                                               ; preds = %2
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #6
  br label %271

43:                                               ; preds = %35
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK10R3Triangle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(132) %44)
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call noundef i32 @_Z12R3IntersectsRK7R3PlaneRK5R3Box(ptr noundef nonnull align 8 dereferenceable(32) %45, ptr noundef nonnull align 8 dereferenceable(56) %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %50, label %49

49:                                               ; preds = %43
  store i32 0, ptr %3, align 4
  br label %269

50:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 384, ptr %9) #6
  %51 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i32 0, i32 0
  %52 = getelementptr inbounds %class.R3Point, ptr %51, i64 16
  br label %53

53:                                               ; preds = %53, %50
  %54 = phi ptr [ %51, %50 ], [ %55, %53 ]
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %54)
  %55 = getelementptr inbounds %class.R3Point, ptr %54, i64 1
  %56 = icmp eq ptr %55, %52
  br i1 %56, label %57, label %53

57:                                               ; preds = %53
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %58, i32 noundef 0)
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %59)
  %61 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 0
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %63, i32 noundef 1)
  %65 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %64)
  %66 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 1
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(24) %65)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %68, i32 noundef 2)
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %69)
  %71 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 2
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 8 dereferenceable(24) %70)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 3, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %73

73:                                               ; preds = %250, %57
  %74 = load i32, ptr %11, align 4, !tbaa !11
  %75 = icmp sle i32 %74, 1
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 2, ptr %12, align 4
  br label %253

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %244, %77
  %79 = load i32, ptr %13, align 4, !tbaa !11
  %80 = icmp sle i32 %79, 2
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 5, ptr %12, align 4
  br label %247

82:                                               ; preds = %78
  %83 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 0
  %84 = load i32, ptr %10, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %85
  %87 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(24) %83)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %88

88:                                               ; preds = %228, %82
  %89 = load i32, ptr %14, align 4, !tbaa !11
  %90 = load i32, ptr %10, align 4, !tbaa !11
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %231

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %94 = load i32, ptr %14, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %95
  store ptr %96, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %99
  store ptr %100, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !11
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %101, i32 noundef %102)
  %104 = load double, ptr %103, align 8, !tbaa !13
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !11
  %107 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %105, i32 noundef %106)
  %108 = load i32, ptr %13, align 4, !tbaa !11
  %109 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %107, i32 noundef %108)
  %110 = fsub double %104, %109
  store double %110, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = load i32, ptr %13, align 4, !tbaa !11
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %111, i32 noundef %112)
  %114 = load double, ptr %113, align 8, !tbaa !13
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i32, ptr %11, align 4, !tbaa !11
  %117 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %115, i32 noundef %116)
  %118 = load i32, ptr %13, align 4, !tbaa !11
  %119 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %117, i32 noundef %118)
  %120 = fsub double %114, %119
  store double %120, ptr %18, align 8, !tbaa !13
  %121 = load i32, ptr %11, align 4, !tbaa !11
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %128

123:                                              ; preds = %93
  %124 = load double, ptr %17, align 8, !tbaa !13
  %125 = fneg double %124
  store double %125, ptr %17, align 8, !tbaa !13
  %126 = load double, ptr %18, align 8, !tbaa !13
  %127 = fneg double %126
  store double %127, ptr %18, align 8, !tbaa !13
  br label %128

128:                                              ; preds = %123, %93
  %129 = load double, ptr %17, align 8, !tbaa !13
  %130 = fcmp olt double %129, 0.000000e+00
  br i1 %130, label %131, label %177

131:                                              ; preds = %128
  %132 = load double, ptr %18, align 8, !tbaa !13
  %133 = fcmp ogt double %132, 0.000000e+00
  br i1 %133, label %134, label %176

134:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %135 = load double, ptr %18, align 8, !tbaa !13
  %136 = load double, ptr %17, align 8, !tbaa !13
  %137 = fneg double %136
  %138 = fadd double %135, %137
  store double %138, ptr %19, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %139 = load double, ptr %18, align 8, !tbaa !13
  %140 = load double, ptr %19, align 8, !tbaa !13
  %141 = fdiv double %139, %140
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %21, double noundef %141, ptr noundef nonnull align 8 dereferenceable(24) %142)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  %143 = load double, ptr %17, align 8, !tbaa !13
  %144 = fneg double %143
  %145 = load double, ptr %19, align 8, !tbaa !13
  %146 = fdiv double %144, %145
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %22, double noundef %146, ptr noundef nonnull align 8 dereferenceable(24) %147)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %148 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %148, ptr %23, align 4, !tbaa !11
  br label %149

149:                                              ; preds = %163, %134
  %150 = load i32, ptr %23, align 4, !tbaa !11
  %151 = load i32, ptr %14, align 4, !tbaa !11
  %152 = icmp sgt i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %166

154:                                              ; preds = %149
  %155 = load i32, ptr %23, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %156
  %158 = load i32, ptr %23, align 4, !tbaa !11
  %159 = add nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %160
  %162 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %161, ptr noundef nonnull align 8 dereferenceable(24) %157)
  br label %163

163:                                              ; preds = %154
  %164 = load i32, ptr %23, align 4, !tbaa !11
  %165 = add nsw i32 %164, -1
  store i32 %165, ptr %23, align 4, !tbaa !11
  br label %149, !llvm.loop !15

166:                                              ; preds = %153
  %167 = load i32, ptr %14, align 4, !tbaa !11
  %168 = add nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %169
  %171 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %170, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %172 = load i32, ptr %10, align 4, !tbaa !11
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %10, align 4, !tbaa !11
  %174 = load i32, ptr %14, align 4, !tbaa !11
  %175 = add nsw i32 %174, 2
  store i32 %175, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %176

176:                                              ; preds = %166, %131
  br label %227

177:                                              ; preds = %128
  %178 = load double, ptr %17, align 8, !tbaa !13
  %179 = fcmp ogt double %178, 0.000000e+00
  br i1 %179, label %180, label %226

180:                                              ; preds = %177
  %181 = load double, ptr %18, align 8, !tbaa !13
  %182 = fcmp olt double %181, 0.000000e+00
  br i1 %182, label %183, label %201

183:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %184 = load double, ptr %18, align 8, !tbaa !13
  %185 = fneg double %184
  %186 = load double, ptr %17, align 8, !tbaa !13
  %187 = fadd double %185, %186
  store double %187, ptr %24, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #6
  %188 = load double, ptr %18, align 8, !tbaa !13
  %189 = fneg double %188
  %190 = load double, ptr %24, align 8, !tbaa !13
  %191 = fdiv double %189, %190
  %192 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %26, double noundef %191, ptr noundef nonnull align 8 dereferenceable(24) %192)
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  %193 = load double, ptr %17, align 8, !tbaa !13
  %194 = load double, ptr %24, align 8, !tbaa !13
  %195 = fdiv double %193, %194
  %196 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZmldRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %27, double noundef %195, ptr noundef nonnull align 8 dereferenceable(24) %196)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %25, ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #6
  %197 = load i32, ptr %14, align 4, !tbaa !11
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %198
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %199, ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %225

201:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %202 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %202, ptr %28, align 4, !tbaa !11
  br label %203

203:                                              ; preds = %217, %201
  %204 = load i32, ptr %28, align 4, !tbaa !11
  %205 = load i32, ptr %10, align 4, !tbaa !11
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %220

208:                                              ; preds = %203
  %209 = load i32, ptr %28, align 4, !tbaa !11
  %210 = add nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %211
  %213 = load i32, ptr %28, align 4, !tbaa !11
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [16 x %class.R3Point], ptr %9, i64 0, i64 %214
  %216 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %215, ptr noundef nonnull align 8 dereferenceable(24) %212)
  br label %217

217:                                              ; preds = %208
  %218 = load i32, ptr %28, align 4, !tbaa !11
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %28, align 4, !tbaa !11
  br label %203, !llvm.loop !17

220:                                              ; preds = %207
  %221 = load i32, ptr %10, align 4, !tbaa !11
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr %10, align 4, !tbaa !11
  %223 = load i32, ptr %14, align 4, !tbaa !11
  %224 = add nsw i32 %223, -1
  store i32 %224, ptr %14, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %220, %183
  br label %226

226:                                              ; preds = %225, %177
  br label %227

227:                                              ; preds = %226, %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %14, align 4, !tbaa !11
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %14, align 4, !tbaa !11
  br label %88, !llvm.loop !18

231:                                              ; preds = %92
  %232 = load i32, ptr %10, align 4, !tbaa !11
  %233 = icmp eq i32 %232, 0
  br i1 %233, label %234, label %235

234:                                              ; preds = %231
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %247

235:                                              ; preds = %231
  %236 = load i32, ptr %10, align 4, !tbaa !11
  %237 = icmp slt i32 %236, 16
  br i1 %237, label %239, label %238

238:                                              ; preds = %235
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.3, ptr noundef @.str.13, i32 noundef 2055, ptr noundef @.str.5)
  br label %239

239:                                              ; preds = %238, %235
  %240 = load i32, ptr %10, align 4, !tbaa !11
  %241 = icmp sgt i32 %240, 0
  br i1 %241, label %243, label %242

242:                                              ; preds = %239
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.3, ptr noundef @.str.14, i32 noundef 2056, ptr noundef @.str.5)
  br label %243

243:                                              ; preds = %242, %239
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %13, align 4, !tbaa !11
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %13, align 4, !tbaa !11
  br label %78, !llvm.loop !19

247:                                              ; preds = %234, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %248 = load i32, ptr %12, align 4
  switch i32 %248, label %253 [
    i32 5, label %249
  ]

249:                                              ; preds = %247
  br label %250

250:                                              ; preds = %249
  %251 = load i32, ptr %11, align 4, !tbaa !11
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %11, align 4, !tbaa !11
  br label %73, !llvm.loop !20

253:                                              ; preds = %247, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %254 = load i32, ptr %12, align 4
  switch i32 %254, label %268 [
    i32 2, label %255
  ]

255:                                              ; preds = %253
  %256 = load i32, ptr %10, align 4, !tbaa !11
  %257 = icmp sle i32 %256, 0
  br i1 %257, label %258, label %259

258:                                              ; preds = %255
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %268

259:                                              ; preds = %255
  %260 = load i32, ptr %10, align 4, !tbaa !11
  %261 = icmp eq i32 %260, 1
  br i1 %261, label %262, label %263

262:                                              ; preds = %259
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %268

263:                                              ; preds = %259
  %264 = load i32, ptr %10, align 4, !tbaa !11
  %265 = icmp eq i32 %264, 2
  br i1 %265, label %266, label %267

266:                                              ; preds = %263
  store i32 4, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %268

267:                                              ; preds = %263
  store i32 6, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %268

268:                                              ; preds = %267, %266, %262, %258, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 384, ptr %9) #6
  br label %269

269:                                              ; preds = %268, %49, %38
  %270 = load i32, ptr %3, align 4
  ret i32 %270

271:                                              ; preds = %39
  %272 = load ptr, ptr %7, align 8
  %273 = load i32, ptr %8, align 4
  %274 = insertvalue { ptr, i32 } poison, ptr %272, 0
  %275 = insertvalue { ptr, i32 } %274, i32 %273, 1
  resume { ptr, i32 } %275
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

declare void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK7R3Point(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #1

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK10R3Triangle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK7R3PlaneRK5R3Box(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK10R3TriangleRK5R3Box(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(56) %1) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.R3Box, align 8
  %4 = alloca [16 x %class.R3Point], align 16
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R3Point, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca %class.R3Point, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #6
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 136
  %13 = load ptr, ptr %12, align 8
  call void %13(ptr dead_on_unwind nonnull writable sret(%class.R3Box) align 8 %3, ptr noundef nonnull align 8 dereferenceable(132) %0)
  %14 = invoke noundef i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef null)
          to label %15 unwind label %16

15:                                               ; preds = %2
  %.not = icmp eq i32 %14, 0
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #6
  br i1 %.not, label %162, label %18

16:                                               ; preds = %2
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #6
  resume { ptr, i32 } %17

18:                                               ; preds = %15
  %19 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK10R3Triangle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(132) %0)
  %20 = call noundef i32 @_Z12R3IntersectsRK7R3PlaneRK5R3Box(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(56) %1)
  %.not94 = icmp eq i32 %20, 0
  br i1 %.not94, label %162, label %.preheader102

.preheader102:                                    ; preds = %18
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %4) #6
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.ptr.1 = getelementptr inbounds i8, ptr %4, i64 24
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %4, i64 48
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %4, i64 72
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %4, i64 96
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %4, i64 120
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %4, i64 144
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.6)
  %.ptr.7 = getelementptr inbounds i8, ptr %4, i64 168
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.7)
  %.ptr.8 = getelementptr inbounds i8, ptr %4, i64 192
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.8)
  %.ptr.9 = getelementptr inbounds i8, ptr %4, i64 216
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.9)
  %.ptr.10 = getelementptr inbounds i8, ptr %4, i64 240
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.10)
  %.ptr.11 = getelementptr inbounds i8, ptr %4, i64 264
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.11)
  %.ptr.12 = getelementptr inbounds i8, ptr %4, i64 288
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.12)
  %.ptr.13 = getelementptr inbounds i8, ptr %4, i64 312
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.13)
  %.ptr.14 = getelementptr inbounds i8, ptr %4, i64 336
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.14)
  %.ptr.15 = getelementptr inbounds i8, ptr %4, i64 360
  call void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.15)
  %21 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %0, i32 noundef 0)
  %22 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %21)
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %22)
  %24 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %0, i32 noundef 1)
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %24)
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %25)
  %27 = call noundef ptr @_ZNK10R3Triangle6VertexEi(ptr noundef nonnull align 8 dereferenceable(132) %0, i32 noundef 2)
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK16R3TriangleVertex8PositionEv(ptr noundef nonnull align 8 dereferenceable(100) %27)
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %28)
  br label %30

30:                                               ; preds = %.preheader102, %93
  %.182115 = phi i32 [ 3, %.preheader102 ], [ %.283.lcssa, %93 ]
  %.093114 = phi i32 [ 0, %.preheader102 ], [ %94, %93 ]
  %31 = sext i32 %.182115 to i64
  %32 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %34 = icmp sgt i32 %.182115, 0
  br i1 %34, label %.lr.ph112, label %._crit_edge113

._crit_edge113:                                   ; preds = %85, %30
  %.283.lcssa = phi i32 [ %.182115, %30 ], [ %.384, %85 ]
  %35 = icmp eq i32 %.283.lcssa, 0
  br i1 %35, label %.thread145, label %88

.lr.ph112:                                        ; preds = %30, %85
  %.283110 = phi i32 [ %.384, %85 ], [ %.182115, %30 ]
  %.091109 = phi i32 [ %86, %85 ], [ 0, %30 ]
  %36 = sext i32 %.091109 to i64
  %37 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %36
  %38 = add nsw i32 %.091109, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %37, i32 noundef %.093114)
  %42 = load double, ptr %41, align 8, !tbaa !8
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef 0)
  %44 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %43, i32 noundef %.093114)
  %45 = fsub double %42, %44
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %40, i32 noundef %.093114)
  %47 = load double, ptr %46, align 8, !tbaa !8
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef 0)
  %49 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %48, i32 noundef %.093114)
  %50 = fsub double %47, %49
  %51 = fneg double %45
  %52 = fneg double %50
  %53 = fcmp ogt double %45, 0.000000e+00
  br i1 %53, label %54, label %70

54:                                               ; preds = %.lr.ph112
  %55 = fcmp olt double %50, 0.000000e+00
  br i1 %55, label %56, label %85

56:                                               ; preds = %54
  %57 = fsub double %45, %50
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %58 = fdiv double %52, %57
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, double noundef %58, ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %59 = fdiv double %45, %57
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, double noundef %59, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %60 = icmp sgt i32 %.283110, %.091109
  br i1 %60, label %.lr.ph107.preheader, label %._crit_edge108

.lr.ph107.preheader:                              ; preds = %56
  %61 = sext i32 %.283110 to i64
  br label %.lr.ph107

._crit_edge108:                                   ; preds = %.lr.ph107, %56
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %63 = add nsw i32 %.283110, 1
  %64 = add nsw i32 %.091109, 2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %85

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %.lr.ph107
  %indvars.iv124 = phi i64 [ %61, %.lr.ph107.preheader ], [ %indvars.iv.next125, %.lr.ph107 ]
  %65 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv124
  %66 = add nsw i64 %indvars.iv124, 1
  %67 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %66
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %65)
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, -1
  %69 = icmp sgt i64 %indvars.iv.next125, %36
  br i1 %69, label %.lr.ph107, label %._crit_edge108, !llvm.loop !11

70:                                               ; preds = %.lr.ph112
  %71 = fcmp olt double %45, 0.000000e+00
  br i1 %71, label %72, label %85

72:                                               ; preds = %70
  %73 = fcmp ogt double %50, 0.000000e+00
  br i1 %73, label %75, label %.preheader

.preheader:                                       ; preds = %72
  %74 = icmp slt i32 %.091109, %.283110
  br i1 %74, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = sext i32 %.283110 to i64
  br label %.lr.ph

75:                                               ; preds = %72
  %76 = fsub double %50, %45
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %77 = fdiv double %50, %76
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %9, double noundef %77, ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %78 = fdiv double %51, %76
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, double noundef %78, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %85

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %80 = add nsw i32 %.283110, -1
  %81 = add nsw i32 %.091109, -1
  br label %85

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %36, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %82 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv.next
  %83 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 8 dereferenceable(24) %82)
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

85:                                               ; preds = %70, %._crit_edge, %75, %54, %._crit_edge108
  %.192 = phi i32 [ %64, %._crit_edge108 ], [ %.091109, %54 ], [ %.091109, %75 ], [ %81, %._crit_edge ], [ %.091109, %70 ]
  %.384 = phi i32 [ %63, %._crit_edge108 ], [ %.283110, %54 ], [ %.283110, %75 ], [ %80, %._crit_edge ], [ %.283110, %70 ]
  %86 = add nsw i32 %.192, 1
  %87 = icmp slt i32 %86, %.384
  br i1 %87, label %.lr.ph112, label %._crit_edge113, !llvm.loop !14

88:                                               ; preds = %._crit_edge113
  %89 = icmp slt i32 %.283.lcssa, 16
  br i1 %89, label %90, label %.thread

.thread:                                          ; preds = %88
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.13, i32 noundef 2055, ptr noundef nonnull @.str.5)
  br label %93

90:                                               ; preds = %88
  %91 = icmp sgt i32 %.283.lcssa, 0
  br i1 %91, label %93, label %92

92:                                               ; preds = %90
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.14, i32 noundef 2056, ptr noundef nonnull @.str.5)
  br label %93

93:                                               ; preds = %.thread, %90, %92
  %94 = add nuw nsw i32 %.093114, 1
  %exitcond127 = icmp eq i32 %94, 3
  br i1 %exitcond127, label %.thread99, label %30, !llvm.loop !15

.thread99:                                        ; preds = %93, %157
  %.182115.1 = phi i32 [ %.283.lcssa.1.fr, %157 ], [ %.283.lcssa, %93 ]
  %.093114.1 = phi i32 [ %158, %157 ], [ 0, %93 ]
  %95 = sext i32 %.182115.1 to i64
  %96 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %95
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %98 = icmp sgt i32 %.182115.1, 0
  br i1 %98, label %.lr.ph112.1, label %._crit_edge113.1

.lr.ph112.1:                                      ; preds = %.thread99, %148
  %.283110.1 = phi i32 [ %.384.1, %148 ], [ %.182115.1, %.thread99 ]
  %.091109.1 = phi i32 [ %149, %148 ], [ 0, %.thread99 ]
  %99 = sext i32 %.091109.1 to i64
  %100 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %99
  %101 = add nsw i32 %.091109.1, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %102
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %100, i32 noundef %.093114.1)
  %105 = load double, ptr %104, align 8, !tbaa !8
  %106 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef 1)
  %107 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %106, i32 noundef %.093114.1)
  %108 = fsub double %105, %107
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %103, i32 noundef %.093114.1)
  %110 = load double, ptr %109, align 8, !tbaa !8
  %111 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef 1)
  %112 = call noundef double @_ZNK7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %111, i32 noundef %.093114.1)
  %113 = fsub double %110, %112
  %114 = fcmp olt double %108, 0.000000e+00
  br i1 %114, label %131, label %115

115:                                              ; preds = %.lr.ph112.1
  %116 = fcmp ogt double %108, 0.000000e+00
  br i1 %116, label %117, label %148

117:                                              ; preds = %115
  %118 = fcmp olt double %113, 0.000000e+00
  br i1 %118, label %125, label %.preheader.1

.preheader.1:                                     ; preds = %117
  %119 = icmp slt i32 %.091109.1, %.283110.1
  br i1 %119, label %.lr.ph.preheader.1, label %._crit_edge.1

.lr.ph.preheader.1:                               ; preds = %.preheader.1
  %wide.trip.count.1 = sext i32 %.283110.1 to i64
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %indvars.iv.1 = phi i64 [ %99, %.lr.ph.preheader.1 ], [ %indvars.iv.next.1, %.lr.ph.1 ]
  %indvars.iv.next.1 = add nsw i64 %indvars.iv.1, 1
  %120 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv.next.1
  %121 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv.1
  %122 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %121, ptr noundef nonnull align 8 dereferenceable(24) %120)
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count.1
  br i1 %exitcond.1.not, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !13

._crit_edge.1:                                    ; preds = %.lr.ph.1, %.preheader.1
  %123 = add nsw i32 %.283110.1, -1
  %124 = add nsw i32 %.091109.1, -1
  br label %148

125:                                              ; preds = %117
  %126 = fneg double %113
  %127 = fsub double %108, %113
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %128 = fdiv double %126, %127
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %9, double noundef %128, ptr noundef nonnull align 8 dereferenceable(24) %100)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %129 = fdiv double %108, %127
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, double noundef %129, ptr noundef nonnull align 8 dereferenceable(24) %103)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  %130 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %100, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %148

131:                                              ; preds = %.lr.ph112.1
  %132 = fcmp ogt double %113, 0.000000e+00
  br i1 %132, label %133, label %148

133:                                              ; preds = %131
  %134 = fneg double %108
  %135 = fsub double %113, %108
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %136 = fdiv double %113, %135
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, double noundef %136, ptr noundef nonnull align 8 dereferenceable(24) %100)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %137 = fdiv double %134, %135
  call void @_ZmldRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, double noundef %137, ptr noundef nonnull align 8 dereferenceable(24) %103)
  call void @_ZplRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %138 = icmp sgt i32 %.283110.1, %.091109.1
  br i1 %138, label %.lr.ph107.preheader.1, label %._crit_edge108.1

.lr.ph107.preheader.1:                            ; preds = %133
  %139 = sext i32 %.283110.1 to i64
  br label %.lr.ph107.1

.lr.ph107.1:                                      ; preds = %.lr.ph107.1, %.lr.ph107.preheader.1
  %indvars.iv124.1 = phi i64 [ %139, %.lr.ph107.preheader.1 ], [ %indvars.iv.next125.1, %.lr.ph107.1 ]
  %140 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %indvars.iv124.1
  %141 = add nsw i64 %indvars.iv124.1, 1
  %142 = getelementptr inbounds [16 x %class.R3Point], ptr %4, i64 0, i64 %141
  %143 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %142, ptr noundef nonnull align 8 dereferenceable(24) %140)
  %indvars.iv.next125.1 = add nsw i64 %indvars.iv124.1, -1
  %144 = icmp sgt i64 %indvars.iv.next125.1, %99
  br i1 %144, label %.lr.ph107.1, label %._crit_edge108.1, !llvm.loop !11

._crit_edge108.1:                                 ; preds = %.lr.ph107.1, %133
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %146 = add nsw i32 %.283110.1, 1
  %147 = add nsw i32 %.091109.1, 2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %148

148:                                              ; preds = %._crit_edge108.1, %131, %125, %._crit_edge.1, %115
  %.192.1 = phi i32 [ %147, %._crit_edge108.1 ], [ %.091109.1, %131 ], [ %.091109.1, %125 ], [ %124, %._crit_edge.1 ], [ %.091109.1, %115 ]
  %.384.1 = phi i32 [ %146, %._crit_edge108.1 ], [ %.283110.1, %131 ], [ %.283110.1, %125 ], [ %123, %._crit_edge.1 ], [ %.283110.1, %115 ]
  %149 = add nsw i32 %.192.1, 1
  %150 = icmp slt i32 %149, %.384.1
  br i1 %150, label %.lr.ph112.1, label %._crit_edge113.1, !llvm.loop !14

._crit_edge113.1:                                 ; preds = %148, %.thread99
  %.283.lcssa.1 = phi i32 [ %.182115.1, %.thread99 ], [ %.384.1, %148 ]
  %.283.lcssa.1.fr = freeze i32 %.283.lcssa.1
  %151 = icmp eq i32 %.283.lcssa.1.fr, 0
  br i1 %151, label %.thread145, label %152

152:                                              ; preds = %._crit_edge113.1
  %153 = icmp slt i32 %.283.lcssa.1.fr, 16
  br i1 %153, label %154, label %.thread.1

.thread.1:                                        ; preds = %152
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.13, i32 noundef 2055, ptr noundef nonnull @.str.5)
  br label %157

154:                                              ; preds = %152
  %155 = icmp sgt i32 %.283.lcssa.1.fr, 0
  br i1 %155, label %157, label %156

156:                                              ; preds = %154
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.14, i32 noundef 2056, ptr noundef nonnull @.str.5)
  br label %157

157:                                              ; preds = %156, %154, %.thread.1
  %158 = add nuw nsw i32 %.093114.1, 1
  %exitcond127.1 = icmp eq i32 %158, 3
  br i1 %exitcond127.1, label %.thread99.1, label %.thread99, !llvm.loop !15

.thread99.1:                                      ; preds = %157
  %159 = icmp slt i32 %.283.lcssa.1.fr, 1
  %switch.selectcmp = icmp eq i32 %.283.lcssa.1.fr, 2
  %spec.select = select i1 %switch.selectcmp, i32 4, i32 6
  %switch.selectcmp97 = icmp eq i32 %.283.lcssa.1.fr, 1
  %.spec.select = select i1 %switch.selectcmp97, i32 1, i32 %spec.select
  br i1 %159, label %.thread145, label %160

.thread145:                                       ; preds = %._crit_edge113, %._crit_edge113.1, %.thread99.1
  br label %160

160:                                              ; preds = %.thread99.1, %.thread145
  %161 = phi i32 [ 0, %.thread145 ], [ %.spec.select, %.thread99.1 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %4) #6
  br label %162

162:                                              ; preds = %18, %15, %160
  %.4 = phi i32 [ %161, %160 ], [ 0, %15 ], [ 0, %18 ]
  ret i32 %.4
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3BoxixEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZplRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK7R3Point(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass