; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_geometry)

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

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

declare void @Vec3d_sub(ptr noundef, ptr noundef, ptr noundef) #1

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

declare double @Vec3d_normalizeSelf(ptr noundef) #1

declare void @Vec3d_invTransform(ptr noundef, ptr noundef, ptr noundef) #1

declare void @Vec3d_constMul(ptr noundef, ptr noundef, double noundef) #1

declare i32 @VecNd_indexMin(ptr noundef, i32 noundef) #1

declare void @Vec3d_transformSelf(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local double @Math_distPointBox(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca [3 x double], align 16
  %14 = alloca i32, align 4
  %15 = alloca [3 x double], align 16
  %16 = alloca [3 x double], align 16
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  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
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double 1.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %21 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @Vec3d_constMul(ptr noundef %21, ptr noundef %22, double noundef 5.000000e-01)
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  call void @Vec3d_setZero(ptr noundef %23)
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Vec3d_invTransform(ptr noundef %24, ptr noundef %25, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %86, %5
  %28 = load i32, ptr %14, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 3
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %89

31:                                               ; preds = %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i32, ptr %14, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds double, ptr %32, i64 %34
  %36 = load double, ptr %35, align 8, !tbaa !11
  %37 = load i32, ptr %14, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = fneg double %40
  %42 = fcmp olt double %36, %41
  br i1 %42, label %43, label %57

43:                                               ; preds = %31
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = fneg double %47
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %49, i64 %51
  store double %48, ptr %52, align 8, !tbaa !11
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds double, ptr %53, i64 %55
  store double -1.000000e+00, ptr %56, align 8, !tbaa !11
  br label %85

57:                                               ; preds = %31
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = fcmp ogt double %62, %66
  br i1 %67, label %68, label %81

68:                                               ; preds = %57
  %69 = load i32, ptr %14, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds double, ptr %73, i64 %75
  store double %72, ptr %76, align 8, !tbaa !11
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  store double 1.000000e+00, ptr %80, align 8, !tbaa !11
  br label %84

81:                                               ; preds = %57
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %11, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %81, %68
  br label %85

85:                                               ; preds = %84, %43
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %14, align 4, !tbaa !9
  br label %27, !llvm.loop !13

89:                                               ; preds = %30
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 3
  br i1 %91, label %92, label %163

92:                                               ; preds = %89
  store double -1.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %132, %92
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = icmp slt i32 %94, 3
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %135

97:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %98 = load i32, ptr %17, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = fsub double %101, %106
  store double %107, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %108 = load i32, ptr %17, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !11
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = load i32, ptr %17, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = fadd double %111, %116
  store double %117, ptr %19, align 8, !tbaa !11
  %118 = load double, ptr %18, align 8, !tbaa !11
  %119 = load double, ptr %19, align 8, !tbaa !11
  %120 = call double @llvm.minnum.f64(double %118, double %119)
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 %122
  store double %120, ptr %123, align 8, !tbaa !11
  %124 = load double, ptr %18, align 8, !tbaa !11
  %125 = load double, ptr %19, align 8, !tbaa !11
  %126 = fcmp olt double %124, %125
  %127 = zext i1 %126 to i64
  %128 = select i1 %126, double 1.000000e+00, double -1.000000e+00
  %129 = load i32, ptr %17, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %130
  store double %128, ptr %131, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %132

132:                                              ; preds = %97
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %17, align 4, !tbaa !9
  br label %93, !llvm.loop !15

135:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %136 = getelementptr inbounds [3 x double], ptr %16, i64 0, i64 0
  %137 = call i32 @VecNd_indexMin(ptr noundef %136, i32 noundef 3)
  store i32 %137, ptr %20, align 4, !tbaa !9
  %138 = load i32, ptr %20, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = load i32, ptr %20, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = fmul double %141, %145
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  store double %146, ptr %150, align 8, !tbaa !11
  %151 = load i32, ptr %20, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = load i32, ptr %20, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %155, i64 %157
  store double %154, ptr %158, align 8, !tbaa !11
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.HTr, ptr %160, i32 0, i32 1
  %162 = getelementptr inbounds [3 x [3 x double]], ptr %161, i64 0, i64 0
  call void @Vec3d_transRotateSelf(ptr noundef %159, ptr noundef %162)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  br label %163

163:                                              ; preds = %135, %89
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Vec3d_transformSelf(ptr noundef %164, ptr noundef %165)
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = icmp slt i32 %166, 3
  br i1 %167, label %168, label %174

168:                                              ; preds = %163
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  call void @Vec3d_sub(ptr noundef %169, ptr noundef %170, ptr noundef %171)
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = call double @Vec3d_normalizeSelf(ptr noundef %172)
  br label %174

174:                                              ; preds = %168, %163
  %175 = load double, ptr %12, align 8, !tbaa !11
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = call double @Vec3d_distance(ptr noundef %176, ptr noundef %177)
  %179 = fmul double %175, %178
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret double %179
}

declare void @Vec3d_setZero(ptr noundef) #1

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

declare void @Vec3d_transRotateSelf(ptr noundef, ptr noundef) #1

declare double @Vec3d_distance(ptr noundef, ptr 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

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

declare void @Vec3d_sub(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare double @Vec3d_normalizeSelf(ptr noundef) local_unnamed_addr #1

declare void @Vec3d_invTransform(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @Vec3d_constMul(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #1

declare i32 @VecNd_indexMin(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @Vec3d_transformSelf(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local double @Math_distPointBox(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca [3 x double], align 16
  %7 = alloca [3 x double], align 16
  %8 = alloca [3 x double], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @Vec3d_constMul(ptr noundef nonnull %6, ptr noundef %2, double noundef 5.000000e-01) #5
  call void @Vec3d_setZero(ptr noundef %4) #5
  call void @Vec3d_invTransform(ptr noundef %3, ptr noundef %1, ptr noundef %0) #5
  %9 = load double, ptr %3, align 8, !tbaa !5
  %10 = load double, ptr %6, align 16, !tbaa !5
  %11 = fneg double %10
  %12 = fcmp olt double %9, %11
  br i1 %12, label %.sink.split, label %13

13:                                               ; preds = %5
  %14 = fcmp ogt double %9, %10
  br i1 %14, label %.sink.split, label %15

.sink.split:                                      ; preds = %13, %5
  %.sink76 = phi double [ %11, %5 ], [ %10, %13 ]
  %.sink = phi double [ -1.000000e+00, %5 ], [ 1.000000e+00, %13 ]
  store double %.sink76, ptr %3, align 8, !tbaa !5
  store double %.sink, ptr %4, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %.sink.split, %13
  %16 = phi i1 [ true, %13 ], [ false, %.sink.split ]
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = fneg double %20
  %22 = fcmp olt double %18, %21
  br i1 %22, label %.sink.split80, label %23

23:                                               ; preds = %15
  %24 = fcmp ogt double %18, %20
  br i1 %24, label %.sink.split80, label %26

.sink.split80:                                    ; preds = %15, %23
  %.sink83 = phi double [ %20, %23 ], [ %21, %15 ]
  %.sink81 = phi double [ 1.000000e+00, %23 ], [ -1.000000e+00, %15 ]
  store double %.sink83, ptr %17, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %4, i64 8
  store double %.sink81, ptr %25, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %.sink.split80, %23
  %.1.1 = phi i1 [ %16, %23 ], [ false, %.sink.split80 ]
  %27 = getelementptr inbounds i8, ptr %3, i64 16
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %6, i64 16
  %30 = load double, ptr %29, align 16, !tbaa !5
  %31 = fneg double %30
  %32 = fcmp olt double %28, %31
  br i1 %32, label %.thread.sink.split, label %33

33:                                               ; preds = %26
  %34 = fcmp ogt double %28, %30
  br i1 %34, label %.thread.sink.split, label %35

35:                                               ; preds = %33
  br i1 %.1.1, label %36, label %.thread

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %37 = load <2 x double>, ptr %3, align 8, !tbaa !5
  %38 = insertelement <2 x double> poison, double %10, i64 0
  %39 = insertelement <2 x double> %38, double %20, i64 1
  %40 = fsub <2 x double> %39, %37
  %41 = fadd <2 x double> %39, %37
  %42 = call <2 x double> @llvm.minnum.v2f64(<2 x double> %40, <2 x double> %41)
  store <2 x double> %42, ptr %8, align 16, !tbaa !5
  %43 = fcmp olt <2 x double> %40, %41
  %44 = select <2 x i1> %43, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> <double -1.000000e+00, double -1.000000e+00>
  store <2 x double> %44, ptr %7, align 16, !tbaa !5
  %45 = load double, ptr %27, align 8, !tbaa !5
  %46 = fsub double %30, %45
  %47 = fadd double %30, %45
  %48 = call double @llvm.minnum.f64(double %46, double %47)
  %49 = getelementptr inbounds i8, ptr %8, i64 16
  store double %48, ptr %49, align 16, !tbaa !5
  %50 = fcmp olt double %46, %47
  %51 = select i1 %50, double 1.000000e+00, double -1.000000e+00
  %52 = getelementptr inbounds i8, ptr %7, i64 16
  store double %51, ptr %52, align 16, !tbaa !5
  %53 = call i32 @VecNd_indexMin(ptr noundef nonnull %8, i32 noundef 3) #5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %54
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = fmul double %56, %58
  %60 = getelementptr inbounds double, ptr %3, i64 %54
  store double %59, ptr %60, align 8, !tbaa !5
  %61 = getelementptr inbounds double, ptr %4, i64 %54
  store double %56, ptr %61, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %1, i64 24
  call void @Vec3d_transRotateSelf(ptr noundef %4, ptr noundef nonnull %62) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @Vec3d_transformSelf(ptr noundef nonnull %3, ptr noundef %1) #5
  br label %65

.thread.sink.split:                               ; preds = %26, %33
  %.sink79 = phi double [ %30, %33 ], [ %31, %26 ]
  %.sink77 = phi double [ 1.000000e+00, %33 ], [ -1.000000e+00, %26 ]
  store double %.sink79, ptr %27, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %4, i64 16
  store double %.sink77, ptr %63, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %35
  call void @Vec3d_transformSelf(ptr noundef nonnull %3, ptr noundef %1) #5
  call void @Vec3d_sub(ptr noundef %4, ptr noundef %0, ptr noundef nonnull %3) #5
  %64 = call double @Vec3d_normalizeSelf(ptr noundef %4) #5
  br label %65

65:                                               ; preds = %36, %.thread
  %.05774 = phi double [ 1.000000e+00, %.thread ], [ -1.000000e+00, %36 ]
  %66 = call double @Vec3d_distance(ptr noundef nonnull %3, ptr noundef %0) #5
  %67 = fmul double %.05774, %66
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret double %67
}

declare void @Vec3d_setZero(ptr noundef) local_unnamed_addr #1

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

declare void @Vec3d_transRotateSelf(ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @Vec3d_distance(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>) #4

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 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass