; LLVM IR from jrl-umi3218/mc_rtc :: 3rd-party/qhull/src/libqhull (merge)

; 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.qhT = type { i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, double, double, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [29 x i32], i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, [256 x i8], i32, [256 x i8], [512 x i8], i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, double, double, double, double, i32, [6 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, double, double, double, double, i32, i32, i32, i32, i32, i32, ptr, ptr, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.qhstatT = type { [249 x %union.intrealT], [259 x i8], [249 x ptr], [249 x i16], [249 x i8], [249 x i8], [9 x %union.intrealT], i32, i32, i32, i32, double }
%union.intrealT = type { double }
%struct.facetT = type { double, double, double, ptr, %union.anon, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }
%union.anon = type { double }

@qh_qh = external global %struct.qhT, align 8
@qh_qhstat = external global %struct.qhstatT, align 8

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_findbest_test(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %19 = load ptr, ptr %9, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.facetT, ptr %19, i32 0, i32 15
  %21 = load i32, ptr %20, align 8
  %22 = lshr i32 %21, 16
  %23 = and i32 %22, 1
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %45

25:                                               ; preds = %7
  %26 = load ptr, ptr %10, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.facetT, ptr %26, i32 0, i32 15
  %28 = load i32, ptr %27, align 8
  %29 = lshr i32 %28, 16
  %30 = and i32 %29, 1
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %45

32:                                               ; preds = %25
  %33 = load ptr, ptr %11, align 8, !tbaa !9
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %45

36:                                               ; preds = %32
  %37 = load ptr, ptr %11, align 8, !tbaa !9
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.facetT, ptr %38, i32 0, i32 15
  %40 = load i32, ptr %39, align 8
  %41 = lshr i32 %40, 16
  %42 = and i32 %41, 1
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  store i32 1, ptr %18, align 4
  br label %87

45:                                               ; preds = %36, %32, %25, %7
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %68

48:                                               ; preds = %45
  %49 = load i32, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 16), align 8, !tbaa !11
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 16), align 8, !tbaa !11
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.facetT, ptr %51, i32 0, i32 5
  %53 = load ptr, ptr %52, align 8, !tbaa !12
  %54 = load ptr, ptr %10, align 8, !tbaa !9
  call void @qh_distplane(ptr noundef %53, ptr noundef %54, ptr noundef %15)
  %55 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 110), align 8, !tbaa !15
  %56 = sitofp i32 %55 to double
  %57 = load double, ptr %15, align 8, !tbaa !18
  %58 = fmul double %57, %56
  store double %58, ptr %15, align 8, !tbaa !18
  %59 = load double, ptr %15, align 8, !tbaa !18
  %60 = fcmp olt double %59, 0.000000e+00
  br i1 %60, label %61, label %65

61:                                               ; preds = %48
  store double 0.000000e+00, ptr %17, align 8, !tbaa !18
  %62 = load double, ptr %15, align 8, !tbaa !18
  store double %62, ptr %16, align 8, !tbaa !18
  %63 = load double, ptr %15, align 8, !tbaa !18
  %64 = fneg double %63
  store double %64, ptr %15, align 8, !tbaa !18
  br label %67

65:                                               ; preds = %48
  store double 0.000000e+00, ptr %16, align 8, !tbaa !18
  %66 = load double, ptr %15, align 8, !tbaa !18
  store double %66, ptr %17, align 8, !tbaa !18
  br label %67

67:                                               ; preds = %65, %61
  br label %72

68:                                               ; preds = %45
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  %70 = load ptr, ptr %10, align 8, !tbaa !9
  %71 = call double @qh_getdistance(ptr noundef %69, ptr noundef %70, ptr noundef %16, ptr noundef %17)
  store double %71, ptr %15, align 8, !tbaa !18
  br label %72

72:                                               ; preds = %68, %67
  %73 = load double, ptr %15, align 8, !tbaa !18
  %74 = load ptr, ptr %12, align 8, !tbaa !9
  %75 = load double, ptr %74, align 8, !tbaa !18
  %76 = fcmp olt double %73, %75
  br i1 %76, label %77, label %86

77:                                               ; preds = %72
  %78 = load ptr, ptr %10, align 8, !tbaa !9
  %79 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %78, ptr %79, align 8, !tbaa !9
  %80 = load double, ptr %16, align 8, !tbaa !18
  %81 = load ptr, ptr %13, align 8, !tbaa !9
  store double %80, ptr %81, align 8, !tbaa !18
  %82 = load double, ptr %17, align 8, !tbaa !18
  %83 = load ptr, ptr %14, align 8, !tbaa !9
  store double %82, ptr %83, align 8, !tbaa !18
  %84 = load double, ptr %15, align 8, !tbaa !18
  %85 = load ptr, ptr %12, align 8, !tbaa !9
  store double %84, ptr %85, align 8, !tbaa !18
  br label %86

86:                                               ; preds = %77, %72
  store i32 0, ptr %18, align 4
  br label %87

87:                                               ; preds = %86, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  %88 = load i32, ptr %18, align 4
  switch i32 %88, label %90 [
    i32 0, label %89
    i32 1, label %89
  ]

89:                                               ; preds = %87, %87
  ret void

90:                                               ; preds = %87
  unreachable
}

declare double @qh_getdistance(ptr noundef, ptr noundef, 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 40}
!13 = !{!"facetT", !14, i64 0, !14, i64 8, !14, i64 16, !10, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 113, !6, i64 113, !6, i64 113, !6, i64 113, !6, i64 113, !6, i64 113, !6, i64 113, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 114, !6, i64 115, !6, i64 115, !6, i64 115, !6, i64 115, !6, i64 115, !6, i64 115, !6, i64 115, !6, i64 115}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !6, i64 632}
!16 = !{!"qhT", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !14, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !14, i64 64, !14, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !10, i64 104, !6, i64 112, !6, i64 116, !10, i64 120, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !14, i64 160, !14, i64 168, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !14, i64 192, !14, i64 200, !6, i64 208, !6, i64 212, !14, i64 216, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !6, i64 240, !6, i64 244, !6, i64 248, !6, i64 252, !6, i64 256, !6, i64 260, !6, i64 264, !6, i64 268, !6, i64 272, !6, i64 276, !6, i64 280, !6, i64 284, !6, i64 288, !6, i64 292, !6, i64 296, !7, i64 300, !6, i64 416, !6, i64 420, !6, i64 424, !6, i64 428, !6, i64 432, !6, i64 436, !6, i64 440, !6, i64 444, !14, i64 448, !14, i64 456, !14, i64 464, !6, i64 472, !6, i64 476, !6, i64 480, !6, i64 484, !6, i64 488, !6, i64 492, !6, i64 496, !6, i64 500, !6, i64 504, !6, i64 508, !6, i64 512, !6, i64 516, !6, i64 520, !6, i64 524, !6, i64 528, !6, i64 532, !6, i64 536, !6, i64 540, !6, i64 544, !14, i64 552, !6, i64 560, !6, i64 564, !6, i64 568, !6, i64 572, !6, i64 576, !6, i64 580, !6, i64 584, !6, i64 588, !14, i64 592, !6, i64 600, !10, i64 608, !10, i64 616, !6, i64 624, !6, i64 628, !6, i64 632, !6, i64 636, !6, i64 640, !10, i64 648, !6, i64 656, !10, i64 664, !6, i64 672, !7, i64 676, !6, i64 932, !7, i64 936, !7, i64 1192, !6, i64 1704, !6, i64 1708, !6, i64 1712, !6, i64 1716, !6, i64 1720, !6, i64 1724, !10, i64 1728, !10, i64 1736, !10, i64 1744, !10, i64 1752, !14, i64 1760, !14, i64 1768, !14, i64 1776, !14, i64 1784, !14, i64 1792, !14, i64 1800, !14, i64 1808, !14, i64 1816, !14, i64 1824, !14, i64 1832, !14, i64 1840, !14, i64 1848, !14, i64 1856, !14, i64 1864, !10, i64 1872, !14, i64 1880, !14, i64 1888, !14, i64 1896, !14, i64 1904, !6, i64 1912, !7, i64 1916, !7, i64 1928, !7, i64 2128, !7, i64 2168, !7, i64 2368, !10, i64 2408, !10, i64 2416, !10, i64 2424, !10, i64 2432, !6, i64 2440, !6, i64 2444, !6, i64 2448, !10, i64 2456, !10, i64 2464, !10, i64 2472, !10, i64 2480, !10, i64 2488, !6, i64 2496, !6, i64 2500, !10, i64 2504, !6, i64 2512, !10, i64 2520, !6, i64 2528, !10, i64 2536, !10, i64 2544, !10, i64 2552, !10, i64 2560, !6, i64 2568, !6, i64 2572, !6, i64 2576, !6, i64 2580, !6, i64 2584, !6, i64 2588, !6, i64 2592, !6, i64 2596, !17, i64 2600, !6, i64 2608, !6, i64 2612, !6, i64 2616, !6, i64 2620, !6, i64 2624, !10, i64 2632, !10, i64 2640, !6, i64 2648, !6, i64 2652, !6, i64 2656, !14, i64 2664, !6, i64 2672, !14, i64 2680, !14, i64 2688, !14, i64 2696, !6, i64 2704, !6, i64 2708, !6, i64 2712, !6, i64 2716, !6, i64 2720, !14, i64 2728, !14, i64 2736, !6, i64 2744, !6, i64 2748, !6, i64 2752, !6, i64 2756, !6, i64 2760, !6, i64 2764, !14, i64 2768, !14, i64 2776, !6, i64 2784, !6, i64 2788, !6, i64 2792, !6, i64 2796, !10, i64 2800, !10, i64 2808, !10, i64 2816, !10, i64 2824, !10, i64 2832, !10, i64 2840, !10, i64 2848, !10, i64 2856, !10, i64 2864, !6, i64 2872, !10, i64 2880, !10, i64 2888, !6, i64 2896, !6, i64 2900, !6, i64 2904, !10, i64 2912, !14, i64 2920, !14, i64 2928, !14, i64 2936, !14, i64 2944, !6, i64 2952, !6, i64 2956, !6, i64 2960, !6, i64 2964, !6, i64 2968, !6, i64 2972, !10, i64 2976, !10, i64 2984, !6, i64 2992}
!17 = !{!"long", !7, i64 0}
!18 = !{!14, !14, 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.qhT = type { i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, double, double, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [29 x i32], i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, [256 x i8], i32, [256 x i8], [512 x i8], i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, double, double, double, double, i32, [6 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, double, double, double, double, i32, i32, i32, i32, i32, i32, ptr, ptr, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.qhstatT = type { [249 x %union.intrealT], [259 x i8], [249 x ptr], [249 x i16], [249 x i8], [249 x i8], [9 x %union.intrealT], i32, i32, i32, i32, double }
%union.intrealT = type { double }

@qh_qh = external local_unnamed_addr global %struct.qhT, align 8
@qh_qhstat = external local_unnamed_addr global %struct.qhstatT, align 8

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_findbest_test(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef %3, ptr nocapture noundef %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #2 {
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %11 = getelementptr inbounds i8, ptr %1, i64 112
  %12 = load i32, ptr %11, align 8
  %13 = and i32 %12, 65536
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %24, label %14

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %2, i64 112
  %16 = load i32, ptr %15, align 8
  %17 = and i32 %16, 65536
  %.not14 = icmp eq i32 %17, 0
  br i1 %.not14, label %24, label %18

18:                                               ; preds = %14
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %.not15 = icmp eq ptr %19, null
  br i1 %.not15, label %24, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %19, i64 112
  %22 = load i32, ptr %21, align 8
  %23 = and i32 %22, 65536
  %.not16 = icmp eq i32 %23, 0
  br i1 %.not16, label %47, label %24

24:                                               ; preds = %20, %18, %14, %7
  %.not17 = icmp eq i32 %0, 0
  br i1 %.not17, label %38, label %25

25:                                               ; preds = %24
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 128), align 8, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 128), align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %1, i64 40
  %29 = load ptr, ptr %28, align 8, !tbaa !10
  call void @qh_distplane(ptr noundef %29, ptr noundef %2, ptr noundef nonnull %8) #3
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 632), align 8, !tbaa !14
  %31 = sitofp i32 %30 to double
  %32 = load double, ptr %8, align 8, !tbaa !17
  %33 = fmul double %32, %31
  %34 = fcmp olt double %33, 0.000000e+00
  br i1 %34, label %35, label %37

35:                                               ; preds = %25
  store double 0.000000e+00, ptr %10, align 8, !tbaa !17
  store double %33, ptr %9, align 8, !tbaa !17
  %36 = fneg double %33
  br label %40

37:                                               ; preds = %25
  store double 0.000000e+00, ptr %9, align 8, !tbaa !17
  store double %33, ptr %10, align 8, !tbaa !17
  br label %40

38:                                               ; preds = %24
  %39 = call double @qh_getdistance(ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %9, ptr noundef nonnull %10) #3
  br label %40

40:                                               ; preds = %35, %37, %38
  %41 = phi double [ %36, %35 ], [ %33, %37 ], [ %39, %38 ]
  %42 = load double, ptr %4, align 8, !tbaa !17
  %43 = fcmp olt double %41, %42
  br i1 %43, label %44, label %47

44:                                               ; preds = %40
  store ptr %2, ptr %3, align 8, !tbaa !5
  %45 = load double, ptr %9, align 8, !tbaa !17
  store double %45, ptr %5, align 8, !tbaa !17
  %46 = load double, ptr %10, align 8, !tbaa !17
  store double %46, ptr %6, align 8, !tbaa !17
  store double %41, ptr %4, align 8, !tbaa !17
  br label %47

47:                                               ; preds = %40, %44, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 40}
!11 = !{!"facetT", !12, i64 0, !12, i64 8, !12, i64 16, !6, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 113, !13, i64 113, !13, i64 113, !13, i64 113, !13, i64 113, !13, i64 113, !13, i64 113, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 114, !13, i64 115, !13, i64 115, !13, i64 115, !13, i64 115, !13, i64 115, !13, i64 115, !13, i64 115, !13, i64 115}
!12 = !{!"double", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 632}
!15 = !{!"qhT", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !12, i64 64, !12, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !6, i64 104, !13, i64 112, !13, i64 116, !6, i64 120, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148, !13, i64 152, !12, i64 160, !12, i64 168, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !12, i64 192, !12, i64 200, !13, i64 208, !13, i64 212, !12, i64 216, !13, i64 224, !13, i64 228, !13, i64 232, !13, i64 236, !13, i64 240, !13, i64 244, !13, i64 248, !13, i64 252, !13, i64 256, !13, i64 260, !13, i64 264, !13, i64 268, !13, i64 272, !13, i64 276, !13, i64 280, !13, i64 284, !13, i64 288, !13, i64 292, !13, i64 296, !7, i64 300, !13, i64 416, !13, i64 420, !13, i64 424, !13, i64 428, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !12, i64 448, !12, i64 456, !12, i64 464, !13, i64 472, !13, i64 476, !13, i64 480, !13, i64 484, !13, i64 488, !13, i64 492, !13, i64 496, !13, i64 500, !13, i64 504, !13, i64 508, !13, i64 512, !13, i64 516, !13, i64 520, !13, i64 524, !13, i64 528, !13, i64 532, !13, i64 536, !13, i64 540, !13, i64 544, !12, i64 552, !13, i64 560, !13, i64 564, !13, i64 568, !13, i64 572, !13, i64 576, !13, i64 580, !13, i64 584, !13, i64 588, !12, i64 592, !13, i64 600, !6, i64 608, !6, i64 616, !13, i64 624, !13, i64 628, !13, i64 632, !13, i64 636, !13, i64 640, !6, i64 648, !13, i64 656, !6, i64 664, !13, i64 672, !7, i64 676, !13, i64 932, !7, i64 936, !7, i64 1192, !13, i64 1704, !13, i64 1708, !13, i64 1712, !13, i64 1716, !13, i64 1720, !13, i64 1724, !6, i64 1728, !6, i64 1736, !6, i64 1744, !6, i64 1752, !12, i64 1760, !12, i64 1768, !12, i64 1776, !12, i64 1784, !12, i64 1792, !12, i64 1800, !12, i64 1808, !12, i64 1816, !12, i64 1824, !12, i64 1832, !12, i64 1840, !12, i64 1848, !12, i64 1856, !12, i64 1864, !6, i64 1872, !12, i64 1880, !12, i64 1888, !12, i64 1896, !12, i64 1904, !13, i64 1912, !7, i64 1916, !7, i64 1928, !7, i64 2128, !7, i64 2168, !7, i64 2368, !6, i64 2408, !6, i64 2416, !6, i64 2424, !6, i64 2432, !13, i64 2440, !13, i64 2444, !13, i64 2448, !6, i64 2456, !6, i64 2464, !6, i64 2472, !6, i64 2480, !6, i64 2488, !13, i64 2496, !13, i64 2500, !6, i64 2504, !13, i64 2512, !6, i64 2520, !13, i64 2528, !6, i64 2536, !6, i64 2544, !6, i64 2552, !6, i64 2560, !13, i64 2568, !13, i64 2572, !13, i64 2576, !13, i64 2580, !13, i64 2584, !13, i64 2588, !13, i64 2592, !13, i64 2596, !16, i64 2600, !13, i64 2608, !13, i64 2612, !13, i64 2616, !13, i64 2620, !13, i64 2624, !6, i64 2632, !6, i64 2640, !13, i64 2648, !13, i64 2652, !13, i64 2656, !12, i64 2664, !13, i64 2672, !12, i64 2680, !12, i64 2688, !12, i64 2696, !13, i64 2704, !13, i64 2708, !13, i64 2712, !13, i64 2716, !13, i64 2720, !12, i64 2728, !12, i64 2736, !13, i64 2744, !13, i64 2748, !13, i64 2752, !13, i64 2756, !13, i64 2760, !13, i64 2764, !12, i64 2768, !12, i64 2776, !13, i64 2784, !13, i64 2788, !13, i64 2792, !13, i64 2796, !6, i64 2800, !6, i64 2808, !6, i64 2816, !6, i64 2824, !6, i64 2832, !6, i64 2840, !6, i64 2848, !6, i64 2856, !6, i64 2864, !13, i64 2872, !6, i64 2880, !6, i64 2888, !13, i64 2896, !13, i64 2900, !13, i64 2904, !6, i64 2912, !12, i64 2920, !12, i64 2928, !12, i64 2936, !12, i64 2944, !13, i64 2952, !13, i64 2956, !13, i64 2960, !13, i64 2964, !13, i64 2968, !13, i64 2972, !6, i64 2976, !6, i64 2984, !13, i64 2992}
!16 = !{!"long", !7, i64 0}
!17 = !{!12, !12, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass