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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__func__.Math_distPointConvexPolygon2D = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 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

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

; Function Attrs: nounwind uwtable
define dso_local double @Math_distPointConvexPolygon2D(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [2 x double], align 16
  %13 = alloca [2 x double], align 16
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %5
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = icmp ugt i32 %24, 0
  br i1 %25, label %33, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.Math_distPointConvexPolygon2D, i32 noundef 268, ptr noundef @.str.2) #5
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.3) #5
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.4) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

33:                                               ; preds = %23
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %68

37:                                               ; preds = %34
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %53

40:                                               ; preds = %37
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds [2 x double], ptr %41, i64 0
  %43 = getelementptr inbounds [2 x double], ptr %42, i64 0, i64 0
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 0
  store double %44, ptr %46, align 8, !tbaa !11
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds [2 x double], ptr %47, i64 0
  %49 = getelementptr inbounds [2 x double], ptr %48, i64 0, i64 1
  %50 = load double, ptr %49, align 8, !tbaa !11
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %51, i64 1
  store double %50, ptr %52, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %40, %37
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %61

56:                                               ; preds = %53
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 0
  store double 0.000000e+00, ptr %58, align 8, !tbaa !11
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds double, ptr %59, i64 1
  store double 1.000000e+00, ptr %60, align 8, !tbaa !11
  br label %61

61:                                               ; preds = %56, %53
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds [2 x double], ptr %63, i64 0
  %65 = getelementptr inbounds [2 x double], ptr %64, i64 0, i64 0
  %66 = call double @VecNd_sqrDiff(ptr noundef %62, ptr noundef %65, i32 noundef 2)
  %67 = call double @sqrt(double noundef %66) #5
  store double %67, ptr %6, align 8
  br label %148

68:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  br label %75

73:                                               ; preds = %68
  %74 = getelementptr inbounds [2 x double], ptr %12, i64 0, i64 0
  br label %75

75:                                               ; preds = %73, %71
  %76 = phi ptr [ %72, %71 ], [ %74, %73 ]
  store ptr %76, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = call i32 @Math_pointInsideOrOnPolygon2D(ptr noundef %77, ptr noundef %78, i32 noundef %79)
  store i32 %80, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = srem i32 %81, 2
  %83 = icmp ne i32 %82, 0
  %84 = zext i1 %83 to i8
  store i8 %84, ptr %16, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %85 = load i8, ptr %16, align 1, !tbaa !13, !range !15, !noundef !16
  %86 = trunc i8 %85 to i1
  %87 = zext i1 %86 to i32
  %88 = icmp eq i32 %87, 1
  %89 = zext i1 %88 to i64
  %90 = select i1 %88, double -1.000000e+00, double 1.000000e+00
  store double %90, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store double 1.000000e+08, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %129, %75
  %92 = load i32, ptr %19, align 4, !tbaa !9
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = icmp ult i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %132

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = load i32, ptr %19, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds [2 x double], ptr %97, i64 %99
  %101 = getelementptr inbounds [2 x double], ptr %100, i64 0, i64 0
  store ptr %101, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = load i32, ptr %19, align 4, !tbaa !9
  %104 = add i32 %103, 1
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = urem i32 %104, %105
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds [2 x double], ptr %102, i64 %107
  %109 = getelementptr inbounds [2 x double], ptr %108, i64 0, i64 0
  store ptr %109, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = getelementptr inbounds [2 x double], ptr %13, i64 0, i64 0
  %114 = call double @Math_sqrDistPointLineseg2D(ptr noundef %110, ptr noundef %111, ptr noundef %112, ptr noundef %113)
  store double %114, ptr %22, align 8, !tbaa !11
  %115 = load double, ptr %22, align 8, !tbaa !11
  %116 = load double, ptr %18, align 8, !tbaa !11
  %117 = fcmp olt double %115, %116
  br i1 %117, label %118, label %128

118:                                              ; preds = %96
  %119 = load double, ptr %22, align 8, !tbaa !11
  store double %119, ptr %18, align 8, !tbaa !11
  %120 = getelementptr inbounds [2 x double], ptr %13, i64 0, i64 0
  %121 = load double, ptr %120, align 16, !tbaa !11
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = getelementptr inbounds double, ptr %122, i64 0
  store double %121, ptr %123, align 8, !tbaa !11
  %124 = getelementptr inbounds [2 x double], ptr %13, i64 0, i64 1
  %125 = load double, ptr %124, align 8, !tbaa !11
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = getelementptr inbounds double, ptr %126, i64 1
  store double %125, ptr %127, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %118, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %19, align 4, !tbaa !9
  %131 = add i32 %130, 1
  store i32 %131, ptr %19, align 4, !tbaa !9
  br label %91, !llvm.loop !17

132:                                              ; preds = %95
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %143

135:                                              ; preds = %132
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  call void @VecNd_sub(ptr noundef %136, ptr noundef %137, ptr noundef %138, i32 noundef 2)
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = call double @VecNd_normalizeSelf(ptr noundef %139, i32 noundef 2)
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = load double, ptr %17, align 8, !tbaa !11
  call void @VecNd_constMulSelf(ptr noundef %141, double noundef %142, i32 noundef 2)
  br label %143

143:                                              ; preds = %135, %132
  %144 = load double, ptr %17, align 8, !tbaa !11
  %145 = load double, ptr %18, align 8, !tbaa !11
  %146 = call double @sqrt(double noundef %145) #5
  %147 = fmul double %144, %146
  store double %147, ptr %6, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %148

148:                                              ; preds = %143, %61
  %149 = load double, ptr %6, align 8
  ret double %149
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

declare void @print_trace() #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

declare double @VecNd_sqrDiff(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @Math_pointInsideOrOnPolygon2D(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden double @Math_sqrDistPointLineseg2D(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @VecNd_sub(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare double @VecNd_normalizeSelf(ptr noundef, i32 noundef) #3

declare void @VecNd_constMulSelf(ptr noundef, double noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { noreturn 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 = { nounwind }
attributes #6 = { noreturn 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 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__func__.Math_distPointConvexPolygon2D = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 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

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

; Function Attrs: nounwind uwtable
define dso_local double @Math_distPointConvexPolygon2D(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca [2 x double], align 16
  %7 = alloca [2 x double], align 16
  switch i32 %2, label %.lr.ph [
    i32 0, label %8
    i32 1, label %15
  ]

8:                                                ; preds = %5
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.Math_distPointConvexPolygon2D, i32 noundef 268, ptr noundef nonnull @.str.2) #6
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.3) #6
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

15:                                               ; preds = %5
  %.not54 = icmp eq ptr %3, null
  br i1 %.not54, label %21, label %16

16:                                               ; preds = %15
  %17 = load double, ptr %1, align 8, !tbaa !9
  store double %17, ptr %3, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  store double %19, ptr %20, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %16, %15
  %.not55 = icmp eq ptr %4, null
  br i1 %.not55, label %23, label %22

22:                                               ; preds = %21
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %4, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %22, %21
  %24 = tail call double @VecNd_sqrDiff(ptr noundef %0, ptr noundef %1, i32 noundef 2) #7
  %25 = tail call double @sqrt(double noundef %24) #7
  br label %49

.lr.ph:                                           ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %.not51 = icmp eq ptr %3, null
  %26 = select i1 %.not51, ptr %6, ptr %3
  %27 = tail call i32 @Math_pointInsideOrOnPolygon2D(ptr noundef %0, ptr noundef %1, i32 noundef %2)
  %28 = and i32 %27, 1
  %.not52 = icmp eq i32 %28, 0
  %29 = select i1 %.not52, double 1.000000e+00, double -1.000000e+00
  %30 = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.sel.v.sroa.sel.v.sroa.sel.v = select i1 %.not51, ptr %6, ptr %3
  %.sroa.sel.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %.sroa.sel.v.sroa.sel.v.sroa.sel.v, i64 8
  %31 = zext i32 %2 to i64
  br label %32

._crit_edge:                                      ; preds = %43
  %.not53 = icmp eq ptr %4, null
  br i1 %.not53, label %46, label %44

32:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %.04458 = phi double [ 1.000000e+08, %.lr.ph ], [ %.1, %43 ]
  %33 = getelementptr inbounds [2 x double], ptr %1, i64 %indvars.iv
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = icmp eq i64 %indvars.iv.next, %31
  %35 = and i64 %indvars.iv.next, 4294967295
  %36 = select i1 %34, i64 0, i64 %35
  %37 = getelementptr inbounds [2 x double], ptr %1, i64 %36
  %38 = call double @Math_sqrDistPointLineseg2D(ptr noundef %0, ptr noundef %33, ptr noundef %37, ptr noundef nonnull %7)
  %39 = fcmp olt double %38, %.04458
  br i1 %39, label %40, label %43

40:                                               ; preds = %32
  %41 = load double, ptr %7, align 16, !tbaa !9
  store double %41, ptr %26, align 8, !tbaa !9
  %42 = load double, ptr %30, align 8, !tbaa !9
  store double %42, ptr %.sroa.sel.v.sroa.sel.v.sroa.sel, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %40, %32
  %.1 = phi double [ %38, %40 ], [ %.04458, %32 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next, %31
  br i1 %exitcond.not, label %._crit_edge, label %32, !llvm.loop !11

44:                                               ; preds = %._crit_edge
  call void @VecNd_sub(ptr noundef nonnull %4, ptr noundef %0, ptr noundef nonnull %26, i32 noundef 2) #7
  %45 = call double @VecNd_normalizeSelf(ptr noundef nonnull %4, i32 noundef 2) #7
  call void @VecNd_constMulSelf(ptr noundef nonnull %4, double noundef %29, i32 noundef 2) #7
  br label %46

46:                                               ; preds = %44, %._crit_edge
  %47 = call double @sqrt(double noundef %.1) #7
  %48 = fmul double %29, %47
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %49

49:                                               ; preds = %46, %23
  %.0 = phi double [ %25, %23 ], [ %48, %46 ]
  ret double %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @print_trace() local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

declare double @VecNd_sqrDiff(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @Math_pointInsideOrOnPolygon2D(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden double @Math_sqrDistPointLineseg2D(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @VecNd_sub(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare double @VecNd_normalizeSelf(ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @VecNd_constMulSelf(ptr noundef, double noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nofree 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 #4 = { "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 = { noreturn 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 #6 = { cold nounwind }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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