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

; 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.R3Point = type { [3 x double] }

@RN_EPSILON = external global double, align 8

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK6R3SpanRK7R3PlaneP7R3PointPd(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca %class.R3Point, align 8
  %15 = alloca double, align 8
  %16 = alloca %class.R3Point, align 8
  %17 = alloca double, align 8
  %18 = alloca %class.R3Point, align 8
  %19 = alloca double, align 8
  %20 = alloca %class.R3Point, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %22)
  %24 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(24) %23)
  store double %24, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %26)
  %28 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(24) %27)
  store double %28, ptr %11, align 8, !tbaa !9
  %29 = load double, ptr %10, align 8, !tbaa !9
  %30 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %31 = call noundef i32 @_Z12RNIsPositivedd(double noundef %29, double noundef %30)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %81

33:                                               ; preds = %4
  %34 = load double, ptr %11, align 8, !tbaa !9
  %35 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %36 = call noundef i32 @_Z12RNIsPositivedd(double noundef %34, double noundef %35)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

39:                                               ; preds = %33
  %40 = load double, ptr %11, align 8, !tbaa !9
  %41 = fcmp oge double %40, 0.000000e+00
  br i1 %41, label %42, label %58

42:                                               ; preds = %39
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %46)
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %47)
  br label %50

50:                                               ; preds = %45, %42
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %57

53:                                               ; preds = %50
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %54)
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  store double %55, ptr %56, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %53, %50
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

58:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %59)
  %61 = load double, ptr %10, align 8, !tbaa !9
  %62 = fmul double %60, %61
  %63 = load double, ptr %10, align 8, !tbaa !9
  %64 = load double, ptr %11, align 8, !tbaa !9
  %65 = fsub double %63, %64
  %66 = fdiv double %62, %65
  store double %66, ptr %13, align 8, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %74

69:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #4
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load double, ptr %13, align 8, !tbaa !9
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(80) %70, double noundef %71)
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  br label %74

74:                                               ; preds = %69, %58
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %80

77:                                               ; preds = %74
  %78 = load double, ptr %13, align 8, !tbaa !9
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  store double %78, ptr %79, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %77, %74
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %225

81:                                               ; preds = %4
  %82 = load double, ptr %10, align 8, !tbaa !9
  %83 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %84 = call noundef i32 @_Z12RNIsNegativedd(double noundef %82, double noundef %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %134

86:                                               ; preds = %81
  %87 = load double, ptr %11, align 8, !tbaa !9
  %88 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %89 = call noundef i32 @_Z12RNIsNegativedd(double noundef %87, double noundef %88)
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %86
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

92:                                               ; preds = %86
  %93 = load double, ptr %11, align 8, !tbaa !9
  %94 = fcmp ole double %93, 0.000000e+00
  br i1 %94, label %95, label %111

95:                                               ; preds = %92
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %103

98:                                               ; preds = %95
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %99)
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %101, ptr noundef nonnull align 8 dereferenceable(24) %100)
  br label %103

103:                                              ; preds = %98, %95
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %110

106:                                              ; preds = %103
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %107)
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  store double %108, ptr %109, align 8, !tbaa !9
  br label %110

110:                                              ; preds = %106, %103
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

111:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %112)
  %114 = load double, ptr %10, align 8, !tbaa !9
  %115 = fmul double %113, %114
  %116 = load double, ptr %10, align 8, !tbaa !9
  %117 = load double, ptr %11, align 8, !tbaa !9
  %118 = fsub double %116, %117
  %119 = fdiv double %115, %118
  store double %119, ptr %15, align 8, !tbaa !9
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %127

122:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load double, ptr %15, align 8, !tbaa !9
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %16, ptr noundef nonnull align 8 dereferenceable(80) %123, double noundef %124)
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %125, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  br label %127

127:                                              ; preds = %122, %111
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %133

130:                                              ; preds = %127
  %131 = load double, ptr %15, align 8, !tbaa !9
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  store double %131, ptr %132, align 8, !tbaa !9
  br label %133

133:                                              ; preds = %130, %127
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %225

134:                                              ; preds = %81
  %135 = load double, ptr %11, align 8, !tbaa !9
  %136 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %137 = call noundef i32 @_Z12RNIsPositivedd(double noundef %135, double noundef %136)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %179

139:                                              ; preds = %134
  %140 = load double, ptr %10, align 8, !tbaa !9
  %141 = fcmp oge double %140, 0.000000e+00
  br i1 %141, label %142, label %156

142:                                              ; preds = %139
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %150

145:                                              ; preds = %142
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %146)
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %148, ptr noundef nonnull align 8 dereferenceable(24) %147)
  br label %150

150:                                              ; preds = %145, %142
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %155

153:                                              ; preds = %150
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %154, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %153, %150
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

156:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %157)
  %159 = load double, ptr %10, align 8, !tbaa !9
  %160 = fmul double %158, %159
  %161 = load double, ptr %10, align 8, !tbaa !9
  %162 = load double, ptr %11, align 8, !tbaa !9
  %163 = fsub double %161, %162
  %164 = fdiv double %160, %163
  store double %164, ptr %17, align 8, !tbaa !9
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %172

167:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = load double, ptr %17, align 8, !tbaa !9
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %18, ptr noundef nonnull align 8 dereferenceable(80) %168, double noundef %169)
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %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) %18)
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  br label %172

172:                                              ; preds = %167, %156
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = icmp ne ptr %173, null
  br i1 %174, label %175, label %178

175:                                              ; preds = %172
  %176 = load double, ptr %17, align 8, !tbaa !9
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  store double %176, ptr %177, align 8, !tbaa !9
  br label %178

178:                                              ; preds = %175, %172
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %225

179:                                              ; preds = %134
  %180 = load double, ptr %11, align 8, !tbaa !9
  %181 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %182 = call noundef i32 @_Z12RNIsNegativedd(double noundef %180, double noundef %181)
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %224

184:                                              ; preds = %179
  %185 = load double, ptr %10, align 8, !tbaa !9
  %186 = fcmp ole double %185, 0.000000e+00
  br i1 %186, label %187, label %201

187:                                              ; preds = %184
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %195

190:                                              ; preds = %187
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %191)
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %193, ptr noundef nonnull align 8 dereferenceable(24) %192)
  br label %195

195:                                              ; preds = %190, %187
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = icmp ne ptr %196, null
  br i1 %197, label %198, label %200

198:                                              ; preds = %195
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %199, align 8, !tbaa !9
  br label %200

200:                                              ; preds = %198, %195
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

201:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %202)
  %204 = load double, ptr %10, align 8, !tbaa !9
  %205 = fmul double %203, %204
  %206 = load double, ptr %10, align 8, !tbaa !9
  %207 = load double, ptr %11, align 8, !tbaa !9
  %208 = fsub double %206, %207
  %209 = fdiv double %205, %208
  store double %209, ptr %19, align 8, !tbaa !9
  %210 = load ptr, ptr %8, align 8, !tbaa !5
  %211 = icmp ne ptr %210, null
  br i1 %211, label %212, label %217

212:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = load double, ptr %19, align 8, !tbaa !9
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %20, ptr noundef nonnull align 8 dereferenceable(80) %213, double noundef %214)
  %215 = load ptr, ptr %8, align 8, !tbaa !5
  %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) %20)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  br label %217

217:                                              ; preds = %212, %201
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = icmp ne ptr %218, null
  br i1 %219, label %220, label %223

220:                                              ; preds = %217
  %221 = load double, ptr %19, align 8, !tbaa !9
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  store double %221, ptr %222, align 8, !tbaa !9
  br label %223

223:                                              ; preds = %220, %217
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %225

224:                                              ; preds = %179
  store i32 4, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %225

225:                                              ; preds = %224, %223, %200, %178, %155, %133, %110, %91, %80, %57, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %226 = load i32, ptr %5, align 4
  ret i32 %226
}

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

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


; 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.R3Point = type { [3 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 5) i32 @_Z12R3IntersectsRK6R3SpanRK7R3PlaneP7R3PointPd(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef writeonly %3) local_unnamed_addr #3 {
  %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 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %10 = tail call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %12 = tail call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %11)
  %13 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %14 = tail call noundef i32 @_Z12RNIsPositivedd(double noundef %10, double noundef %13)
  %.not = icmp eq i32 %14, 0
  %15 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  br i1 %.not, label %33, label %16

16:                                               ; preds = %4
  %17 = tail call noundef i32 @_Z12RNIsPositivedd(double noundef %12, double noundef %15)
  %.not109 = icmp eq i32 %17, 0
  br i1 %.not109, label %18, label %89

18:                                               ; preds = %16
  %19 = fcmp ult double %12, 0.000000e+00
  br i1 %19, label %25, label %20

20:                                               ; preds = %18
  %.not112 = icmp eq ptr %2, null
  br i1 %.not112, label %24, label %21

21:                                               ; preds = %20
  %22 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %23 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %22)
  br label %24

24:                                               ; preds = %21, %20
  %.not113 = icmp eq ptr %3, null
  br i1 %.not113, label %89, label %.sink.split.sink.split

25:                                               ; preds = %18
  %26 = tail call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %27 = fmul double %10, %26
  %28 = fsub double %10, %12
  %29 = fdiv double %27, %28
  %.not110 = icmp eq ptr %2, null
  br i1 %.not110, label %32, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %29)
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  br label %32

32:                                               ; preds = %30, %25
  %.not111 = icmp eq ptr %3, null
  br i1 %.not111, label %89, label %.sink.split

33:                                               ; preds = %4
  %34 = tail call noundef i32 @_Z12RNIsNegativedd(double noundef %10, double noundef %15)
  %.not93 = icmp eq i32 %34, 0
  %35 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  br i1 %.not93, label %53, label %36

36:                                               ; preds = %33
  %37 = tail call noundef i32 @_Z12RNIsNegativedd(double noundef %12, double noundef %35)
  %.not104 = icmp eq i32 %37, 0
  br i1 %.not104, label %38, label %89

38:                                               ; preds = %36
  %39 = fcmp ugt double %12, 0.000000e+00
  br i1 %39, label %45, label %40

40:                                               ; preds = %38
  %.not107 = icmp eq ptr %2, null
  br i1 %.not107, label %44, label %41

41:                                               ; preds = %40
  %42 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span3EndEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %43 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %42)
  br label %44

44:                                               ; preds = %41, %40
  %.not108 = icmp eq ptr %3, null
  br i1 %.not108, label %89, label %.sink.split.sink.split

45:                                               ; preds = %38
  %46 = tail call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %47 = fmul double %10, %46
  %48 = fsub double %10, %12
  %49 = fdiv double %47, %48
  %.not105 = icmp eq ptr %2, null
  br i1 %.not105, label %52, label %50

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %52

52:                                               ; preds = %50, %45
  %.not106 = icmp eq ptr %3, null
  br i1 %.not106, label %89, label %.sink.split

53:                                               ; preds = %33
  %54 = tail call noundef i32 @_Z12RNIsPositivedd(double noundef %12, double noundef %35)
  %.not94 = icmp eq i32 %54, 0
  br i1 %.not94, label %70, label %55

55:                                               ; preds = %53
  %56 = fcmp ult double %10, 0.000000e+00
  br i1 %56, label %62, label %57

57:                                               ; preds = %55
  %.not102 = icmp eq ptr %2, null
  br i1 %.not102, label %61, label %58

58:                                               ; preds = %57
  %59 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %60 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %59)
  br label %61

61:                                               ; preds = %58, %57
  %.not103 = icmp eq ptr %3, null
  br i1 %.not103, label %89, label %.sink.split

62:                                               ; preds = %55
  %63 = tail call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %64 = fmul double %10, %63
  %65 = fsub double %10, %12
  %66 = fdiv double %64, %65
  %.not100 = icmp eq ptr %2, null
  br i1 %.not100, label %69, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  br label %69

69:                                               ; preds = %67, %62
  %.not101 = icmp eq ptr %3, null
  br i1 %.not101, label %89, label %.sink.split

70:                                               ; preds = %53
  %71 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %72 = tail call noundef i32 @_Z12RNIsNegativedd(double noundef %12, double noundef %71)
  %.not95 = icmp eq i32 %72, 0
  br i1 %.not95, label %89, label %73

73:                                               ; preds = %70
  %74 = fcmp ugt double %10, 0.000000e+00
  br i1 %74, label %80, label %75

75:                                               ; preds = %73
  %.not98 = icmp eq ptr %2, null
  br i1 %.not98, label %79, label %76

76:                                               ; preds = %75
  %77 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %78 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %77)
  br label %79

79:                                               ; preds = %76, %75
  %.not99 = icmp eq ptr %3, null
  br i1 %.not99, label %89, label %.sink.split

80:                                               ; preds = %73
  %81 = tail call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %82 = fmul double %10, %81
  %83 = fsub double %10, %12
  %84 = fdiv double %82, %83
  %.not96 = icmp eq ptr %2, null
  br i1 %.not96, label %87, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  call void @_ZNK6R3Span5PointEd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %84)
  %86 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %87

87:                                               ; preds = %85, %80
  %.not97 = icmp eq ptr %3, null
  br i1 %.not97, label %89, label %.sink.split

.sink.split.sink.split:                           ; preds = %44, %24
  %88 = tail call noundef double @_ZNK6R3Span6LengthEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %87, %79, %69, %61, %52, %32
  %.sink = phi double [ %29, %32 ], [ %49, %52 ], [ 0.000000e+00, %61 ], [ %66, %69 ], [ 0.000000e+00, %79 ], [ %84, %87 ], [ %88, %.sink.split.sink.split ]
  store double %.sink, ptr %3, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %.sink.split, %70, %87, %79, %69, %61, %52, %44, %36, %32, %24, %16
  %.0 = phi i32 [ 0, %16 ], [ 1, %24 ], [ 1, %32 ], [ 0, %36 ], [ 1, %44 ], [ 1, %52 ], [ 1, %61 ], [ 1, %69 ], [ 1, %79 ], [ 1, %87 ], [ 4, %70 ], [ 1, %.sink.split ]
  ret i32 %.0
}

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

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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