; LLVM IR from xirc/cp-algorithm :: aoj/CGL/CGL7D/main.ll (Z15intersection_clRK7vector2dS1_S1_RSt6vectorIS_SaIS_EE)

; 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"

%struct.vector2 = type { double, double }

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZmlRKdRK7vector2(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2mlERKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_Z11projectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector210normalizedEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_Z10rejectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2EQRKdS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15intersection_clRK7vector2dS1_S1_RSt6vectorIS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(16) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.vector2, align 8
  %15 = alloca %struct.vector2, align 8
  %16 = alloca %struct.vector2, align 8
  %17 = alloca %struct.vector2, align 8
  %18 = alloca %struct.vector2, align 8
  %19 = alloca double, align 8
  %20 = alloca %struct.vector2, align 8
  %21 = alloca %struct.vector2, align 8
  %22 = alloca %struct.vector2, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca %struct.vector2, align 8
  %27 = alloca %struct.vector2, align 8
  %28 = alloca %struct.vector2, align 8
  %29 = alloca %struct.vector2, align 8
  %30 = alloca %struct.vector2, align 8
  %31 = alloca %struct.vector2, align 8
  %32 = alloca %struct.vector2, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNSt6vectorI7vector2SaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNSt6vectorI7vector2SaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call noundef double @_Z11distance_lpRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %37)
  store double %38, ptr %12, align 8, !tbaa !9
  %39 = load double, ptr %12, align 8, !tbaa !9
  %40 = load double, ptr %8, align 8, !tbaa !9
  %41 = fcmp ogt double %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %5
  store i32 2, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %146

43:                                               ; preds = %5
  %44 = call noundef zeroext i1 @_Z2EQRKdS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %8)
  br i1 %44, label %45, label %72

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %51 = extractvalue { double, double } %49, 0
  store double %51, ptr %50, align 8
  %52 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %53 = extractvalue { double, double } %49, 1
  store double %53, ptr %52, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(16) %55)
  %57 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %58 = extractvalue { double, double } %56, 0
  store double %58, ptr %57, align 8
  %59 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %60 = extractvalue { double, double } %56, 1
  store double %60, ptr %59, align 8
  %61 = call { double, double } @_Z11projectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %62 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %63 = extractvalue { double, double } %61, 0
  store double %63, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %65 = extractvalue { double, double } %61, 1
  store double %65, ptr %64, align 8
  %66 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %67 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %68 = extractvalue { double, double } %66, 0
  store double %68, ptr %67, align 8
  %69 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %70 = extractvalue { double, double } %66, 1
  store double %70, ptr %69, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 8 dereferenceable(16) %14)
  store i32 1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %146

72:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store double -1.000000e+00, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 8 dereferenceable(16) %74)
  %76 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %77 = extractvalue { double, double } %75, 0
  store double %77, ptr %76, align 8
  %78 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %79 = extractvalue { double, double } %75, 1
  store double %79, ptr %78, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %80, ptr noundef nonnull align 8 dereferenceable(16) %81)
  %83 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %84 = extractvalue { double, double } %82, 0
  store double %84, ptr %83, align 8
  %85 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %86 = extractvalue { double, double } %82, 1
  store double %86, ptr %85, align 8
  %87 = call { double, double } @_Z10rejectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %22)
  %88 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %89 = extractvalue { double, double } %87, 0
  store double %89, ptr %88, align 8
  %90 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %91 = extractvalue { double, double } %87, 1
  store double %91, ptr %90, align 8
  %92 = call { double, double } @_ZmlRKdRK7vector2(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(16) %20)
  %93 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %94 = extractvalue { double, double } %92, 0
  store double %94, ptr %93, align 8
  %95 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %96 = extractvalue { double, double } %92, 1
  store double %96, ptr %95, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %97 = load double, ptr %8, align 8, !tbaa !9
  %98 = load double, ptr %8, align 8, !tbaa !9
  %99 = call noundef double @_ZNK7vector24normEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
  %100 = fneg double %99
  %101 = call double @llvm.fmuladd.f64(double %97, double %98, double %100)
  store double %101, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store double 0.000000e+00, ptr %25, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = call double @sqrt(double noundef %103) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  store double %104, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 8 dereferenceable(16) %106)
  %108 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %109 = extractvalue { double, double } %107, 0
  store double %109, ptr %108, align 8
  %110 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %111 = extractvalue { double, double } %107, 1
  store double %111, ptr %110, align 8
  %112 = call { double, double } @_ZNK7vector210normalizedEv(ptr noundef nonnull align 8 dereferenceable(16) %28)
  %113 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %114 = extractvalue { double, double } %112, 0
  store double %114, ptr %113, align 8
  %115 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %116 = extractvalue { double, double } %112, 1
  store double %116, ptr %115, align 8
  %117 = call { double, double } @_ZNK7vector2mlERKd(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %118 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %119 = extractvalue { double, double } %117, 0
  store double %119, ptr %118, align 8
  %120 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %121 = extractvalue { double, double } %117, 1
  store double %121, ptr %120, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %123, ptr noundef nonnull align 8 dereferenceable(16) %18)
  %125 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %126 = extractvalue { double, double } %124, 0
  store double %126, ptr %125, align 8
  %127 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %128 = extractvalue { double, double } %124, 1
  store double %128, ptr %127, align 8
  %129 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(16) %26)
  %130 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %131 = extractvalue { double, double } %129, 0
  store double %131, ptr %130, align 8
  %132 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %133 = extractvalue { double, double } %129, 1
  store double %133, ptr %132, align 8
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 8 dereferenceable(16) %29)
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %135, ptr noundef nonnull align 8 dereferenceable(16) %18)
  %137 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %138 = extractvalue { double, double } %136, 0
  store double %138, ptr %137, align 8
  %139 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %140 = extractvalue { double, double } %136, 1
  store double %140, ptr %139, align 8
  %141 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %26)
  %142 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %143 = extractvalue { double, double } %141, 0
  store double %143, ptr %142, align 8
  %144 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %145 = extractvalue { double, double } %141, 1
  store double %145, ptr %144, align 8
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 8 dereferenceable(16) %31)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %146

146:                                              ; preds = %72, %45, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %147 = load i32, ptr %6, align 4
  ret i32 %147
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI7vector2SaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

%struct.vector2 = type { double, double }

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZmlRKdRK7vector2(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2mlERKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_Z11projectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector210normalizedEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_Z10rejectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2EQRKdS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z15intersection_clRK7vector2dS1_S1_RSt6vectorIS_SaIS_EE(ptr noundef nonnull align 8 dereferenceable(16) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(24) %4) local_unnamed_addr #0 {
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca %struct.vector2, align 8
  %9 = alloca %struct.vector2, align 8
  %10 = alloca %struct.vector2, align 8
  %11 = alloca %struct.vector2, align 8
  %12 = alloca %struct.vector2, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.vector2, align 8
  %15 = alloca %struct.vector2, align 8
  %16 = alloca %struct.vector2, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %struct.vector2, align 8
  %21 = alloca %struct.vector2, align 8
  %22 = alloca %struct.vector2, align 8
  %23 = alloca %struct.vector2, align 8
  %24 = alloca %struct.vector2, align 8
  %25 = alloca %struct.vector2, align 8
  %26 = alloca %struct.vector2, align 8
  store double %1, ptr %6, align 8, !tbaa !5
  tail call void @_ZNSt6vectorI7vector2SaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  tail call void @_ZNSt6vectorI7vector2SaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %27 = tail call noundef double @_Z11distance_lpRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %0)
  store double %27, ptr %7, align 8, !tbaa !5
  %28 = fcmp ogt double %27, %1
  br i1 %28, label %100, label %29

29:                                               ; preds = %5
  %30 = call noundef zeroext i1 @_Z2EQRKdS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %30, label %31, label %48

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %32 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %33 = extractvalue { double, double } %32, 0
  store double %33, ptr %10, align 8
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  %35 = extractvalue { double, double } %32, 1
  store double %35, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %36 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %37 = extractvalue { double, double } %36, 0
  store double %37, ptr %11, align 8
  %38 = getelementptr inbounds i8, ptr %11, i64 8
  %39 = extractvalue { double, double } %36, 1
  store double %39, ptr %38, align 8
  %40 = call { double, double } @_Z11projectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %41 = extractvalue { double, double } %40, 0
  store double %41, ptr %9, align 8
  %42 = getelementptr inbounds i8, ptr %9, i64 8
  %43 = extractvalue { double, double } %40, 1
  store double %43, ptr %42, align 8
  %44 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %9)
  %45 = extractvalue { double, double } %44, 0
  store double %45, ptr %8, align 8
  %46 = getelementptr inbounds i8, ptr %8, i64 8
  %47 = extractvalue { double, double } %44, 1
  store double %47, ptr %46, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %100

48:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  store double -1.000000e+00, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  %49 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %50 = extractvalue { double, double } %49, 0
  store double %50, ptr %15, align 8
  %51 = getelementptr inbounds i8, ptr %15, i64 8
  %52 = extractvalue { double, double } %49, 1
  store double %52, ptr %51, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #6
  %53 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %54 = extractvalue { double, double } %53, 0
  store double %54, ptr %16, align 8
  %55 = getelementptr inbounds i8, ptr %16, i64 8
  %56 = extractvalue { double, double } %53, 1
  store double %56, ptr %55, align 8
  %57 = call { double, double } @_Z10rejectionvRK7vector2S1_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %58 = extractvalue { double, double } %57, 0
  store double %58, ptr %14, align 8
  %59 = getelementptr inbounds i8, ptr %14, i64 8
  %60 = extractvalue { double, double } %57, 1
  store double %60, ptr %59, align 8
  %61 = call { double, double } @_ZmlRKdRK7vector2(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(16) %14)
  %62 = extractvalue { double, double } %61, 0
  store double %62, ptr %12, align 8
  %63 = getelementptr inbounds i8, ptr %12, i64 8
  %64 = extractvalue { double, double } %61, 1
  store double %64, ptr %63, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  %65 = load double, ptr %6, align 8, !tbaa !5
  %66 = call noundef double @_ZNK7vector24normEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %67 = fneg double %66
  %68 = call double @llvm.fmuladd.f64(double %65, double %65, double %67)
  store double %68, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #6
  store double 0.000000e+00, ptr %19, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %70 = load double, ptr %69, align 8, !tbaa !5
  %71 = call double @sqrt(double noundef %70) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  store double %71, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #6
  %72 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %73 = extractvalue { double, double } %72, 0
  store double %73, ptr %22, align 8
  %74 = getelementptr inbounds i8, ptr %22, i64 8
  %75 = extractvalue { double, double } %72, 1
  store double %75, ptr %74, align 8
  %76 = call { double, double } @_ZNK7vector210normalizedEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %77 = extractvalue { double, double } %76, 0
  store double %77, ptr %21, align 8
  %78 = getelementptr inbounds i8, ptr %21, i64 8
  %79 = extractvalue { double, double } %76, 1
  store double %79, ptr %78, align 8
  %80 = call { double, double } @_ZNK7vector2mlERKd(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %81 = extractvalue { double, double } %80, 0
  store double %81, ptr %20, align 8
  %82 = getelementptr inbounds i8, ptr %20, i64 8
  %83 = extractvalue { double, double } %80, 1
  store double %83, ptr %82, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #6
  %84 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %85 = extractvalue { double, double } %84, 0
  store double %85, ptr %24, align 8
  %86 = getelementptr inbounds i8, ptr %24, i64 8
  %87 = extractvalue { double, double } %84, 1
  store double %87, ptr %86, align 8
  %88 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %20)
  %89 = extractvalue { double, double } %88, 0
  store double %89, ptr %23, align 8
  %90 = getelementptr inbounds i8, ptr %23, i64 8
  %91 = extractvalue { double, double } %88, 1
  store double %91, ptr %90, align 8
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %23)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #6
  %92 = call { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %93 = extractvalue { double, double } %92, 0
  store double %93, ptr %26, align 8
  %94 = getelementptr inbounds i8, ptr %26, i64 8
  %95 = extractvalue { double, double } %92, 1
  store double %95, ptr %94, align 8
  %96 = call { double, double } @_ZNK7vector2miERKS_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %20)
  %97 = extractvalue { double, double } %96, 0
  store double %97, ptr %25, align 8
  %98 = getelementptr inbounds i8, ptr %25, i64 8
  %99 = extractvalue { double, double } %96, 1
  store double %99, ptr %98, align 8
  call void @_ZNSt6vectorI7vector2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %25)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %100

100:                                              ; preds = %5, %48, %31
  %.0 = phi i32 [ 1, %31 ], [ 0, %48 ], [ 2, %5 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI7vector2SaIS0_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI7vector2SaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK7vector2plERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI7vector2SaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI7vector2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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