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

; 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.R3Vector = type { [3 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Rectangle = type { %class.R3Surface, %class.R3CoordSystem, [2 x double] }
%class.R3Surface = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Point = type { [3 x double] }

@RN_EPSILON = external global double, align 8
@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 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 double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11R3Rectangle5ResetERK7R3PointRK8R3VectorS5_dd(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef %4, double noundef %5) unnamed_addr #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca [3 x %class.R3Vector], align 16
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Vector, align 8
  %18 = alloca double, align 8
  %19 = alloca %class.R3Vector, align 8
  %20 = alloca %class.R3Triad, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store double %4, ptr %11, align 8, !tbaa !9
  store double %5, ptr %12, align 8, !tbaa !9
  %21 = load ptr, ptr %7, align 8
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  %24 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %25 = call noundef i32 @_Z12RNIsPositivedd(double noundef %23, double noundef %24)
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %6
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 342, ptr noundef @.str.5)
  br label %28

28:                                               ; preds = %27, %6
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
  %31 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %32 = call noundef i32 @_Z12RNIsPositivedd(double noundef %30, double noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.3, ptr noundef @.str.6, i32 noundef 343, ptr noundef @.str.5)
  br label %35

35:                                               ; preds = %34, %28
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #4
  %36 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i32 0, i32 0
  %37 = getelementptr inbounds %class.R3Vector, ptr %36, i64 3
  br label %38

38:                                               ; preds = %38, %35
  %39 = phi ptr [ %36, %35 ], [ %40, %38 ]
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %39)
  %40 = getelementptr inbounds %class.R3Vector, ptr %39, i64 1
  %41 = icmp eq ptr %40, %37
  br i1 %41, label %42, label %38

42:                                               ; preds = %38
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(24) %43)
  %46 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %47)
  %50 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #4
  %51 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %52 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(24) %52)
  %53 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %54 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  %55 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %56 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %56)
  %57 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  %59 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  %60 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %61 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(24) %61)
  %62 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 2
  %63 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  %64 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 2
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64)
  %65 = load double, ptr %11, align 8, !tbaa !9
  %66 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %67 = getelementptr inbounds [2 x double], ptr %66, i64 0, i64 0
  store double %65, ptr %67, align 8, !tbaa !9
  %68 = load double, ptr %12, align 8, !tbaa !9
  %69 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %70 = getelementptr inbounds [2 x double], ptr %69, i64 0, i64 1
  store double %68, ptr %70, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #4
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %71 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %72 = getelementptr inbounds [2 x double], ptr %71, i64 0, i64 1
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %75 = getelementptr inbounds [2 x double], ptr %74, i64 0, i64 0
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = fcmp ogt double %73, %76
  br i1 %77, label %78, label %97

78:                                               ; preds = %42
  %79 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %80 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %79)
  %81 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %82 = getelementptr inbounds [2 x double], ptr %81, i64 0, i64 0
  %83 = load double, ptr %82, align 8, !tbaa !9
  store double %83, ptr %18, align 8, !tbaa !9
  %84 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %85 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %86 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 8 dereferenceable(24) %84)
  %87 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %88 = getelementptr inbounds [2 x double], ptr %87, i64 0, i64 1
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %91 = getelementptr inbounds [2 x double], ptr %90, i64 0, i64 0
  store double %89, ptr %91, align 8, !tbaa !9
  %92 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %93 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %17)
  %94 = load double, ptr %18, align 8, !tbaa !9
  %95 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 2
  %96 = getelementptr inbounds [2 x double], ptr %95, i64 0, i64 1
  store double %94, ptr %96, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %78, %42
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #4
  %98 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %99 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %98, ptr noundef nonnull align 8 dereferenceable(24) %99)
  %100 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 2
  %101 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %100, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  %102 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 2
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102)
  %103 = getelementptr inbounds %class.R3Rectangle, ptr %21, i32 0, i32 1
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %20) #4
  %105 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 0
  %106 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 1
  %107 = getelementptr inbounds [3 x %class.R3Vector], ptr %13, i64 0, i64 2
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %20, ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 8 dereferenceable(24) %106, ptr noundef nonnull align 8 dereferenceable(24) %107)
  call void @_ZN13R3CoordSystem5ResetERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96) %103, ptr noundef nonnull align 8 dereferenceable(24) %104, ptr noundef nonnull align 8 dereferenceable(72) %20)
  call void @llvm.lifetime.end.p0(i64 72, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #4
  ret void
}

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

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

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

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

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

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

declare void @_ZN13R3CoordSystem5ResetERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(72)) #1

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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.R3Vector = type { [3 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }

@RN_EPSILON = external local_unnamed_addr global double, align 8
@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 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 double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11R3Rectangle5ResetERK7R3PointRK8R3VectorS5_dd(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef %4, double noundef %5) unnamed_addr #2 align 2 {
  %7 = alloca [3 x %class.R3Vector], align 16
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.R3Vector, align 8
  %10 = alloca %class.R3Vector, align 8
  %11 = alloca %class.R3Vector, align 8
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Triad, align 8
  %14 = tail call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %15 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %16 = tail call noundef i32 @_Z12RNIsPositivedd(double noundef %14, double noundef %15)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %18

17:                                               ; preds = %6
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 342, ptr noundef nonnull @.str.5)
  br label %18

18:                                               ; preds = %17, %6
  %19 = tail call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %20 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %21 = tail call noundef i32 @_Z12RNIsPositivedd(double noundef %19, double noundef %20)
  %.not9 = icmp eq i32 %21, 0
  br i1 %.not9, label %22, label %23

22:                                               ; preds = %18
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.6, i32 noundef 343, ptr noundef nonnull @.str.5)
  br label %23

23:                                               ; preds = %22, %18
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #4
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %.ptr.1 = getelementptr inbounds i8, ptr %7, i64 24
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %7, i64 48
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #4
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %29 = getelementptr inbounds i8, ptr %0, i64 104
  store double %4, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 112
  store double %5, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = load double, ptr %29, align 8, !tbaa !5
  %33 = fcmp ogt double %31, %32
  br i1 %33, label %34, label %40

34:                                               ; preds = %23
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %36 = load double, ptr %29, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %38 = load double, ptr %30, align 8, !tbaa !5
  store double %38, ptr %29, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %11)
  store double %36, ptr %30, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %34, %23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #4
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %13) #4
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %13, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  call void @_ZN13R3CoordSystem5ResetERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96) %42, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(72) %13)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #4
  ret void
}

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

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

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

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

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

declare void @_ZN13R3CoordSystem5ResetERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass