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

; 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, i32, i32, [1 x %struct.__jmp_buf_tag], [40 x i8], i32, double, ptr, ptr, ptr, %struct.qhmemT, %struct.qhstatT }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.qhmemT = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%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 }
%struct.vertexT = type { ptr, ptr, ptr, ptr, i32, i32, i8 }

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

declare void @qh_initmergesets(ptr noundef) #1

declare void @qh_resetlists(ptr noundef, i32 noundef, i32 noundef) #1

declare void @qh_all_vertexmerges(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare void @qh_freemergesets(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 i32 @qh_pointid(ptr noundef, ptr noundef) #1

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

declare void @qh_printlists(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @qh_buildcone_mergepinched(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %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 ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr null, ptr %17, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call double @qh_matchnewfacets(ptr noundef %18)
  store double %19, ptr %13, align 8, !tbaa !9
  %20 = load double, ptr %13, align 8, !tbaa !9
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.qhT, ptr %21, i32 0, i32 147
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = fmul double 4.000000e+00, %23
  %25 = fcmp ogt double %20, %24
  br i1 %25, label %26, label %106

26:                                               ; preds = %4
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.qhT, ptr %27, i32 0, i32 29
  %29 = load i32, ptr %28, align 8, !tbaa !17
  %30 = icmp sge i32 %29, 4
  br i1 %30, label %31, label %38

31:                                               ; preds = %26
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.qhT, ptr %32, i32 0, i32 178
  %34 = load i32, ptr %33, align 8, !tbaa !18
  %35 = icmp slt i32 %34, 1000
  br i1 %35, label %36, label %38

36:                                               ; preds = %31
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_printlists(ptr noundef %37)
  br label %38

38:                                               ; preds = %36, %31, %26
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_initmergesets(ptr noundef %39)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load double, ptr %13, align 8, !tbaa !9
  %43 = call i32 @qh_getpinchedmerges(ptr noundef %40, ptr noundef %41, double noundef %42, ptr noundef %15)
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %104

45:                                               ; preds = %38
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.qhT, ptr %46, i32 0, i32 166
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  store ptr %48, ptr %10, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %65, %45
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %57

52:                                               ; preds = %49
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.facetT, ptr %53, i32 0, i32 7
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = icmp ne ptr %55, null
  br label %57

57:                                               ; preds = %52, %49
  %58 = phi i1 [ false, %49 ], [ %56, %52 ]
  br i1 %58, label %59, label %67

59:                                               ; preds = %57
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.facetT, ptr %60, i32 0, i32 7
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  store ptr %62, ptr %11, align 8, !tbaa !5
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  call void @qh_delfacet(ptr noundef %63, ptr noundef %64)
  br label %65

65:                                               ; preds = %59
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %66, ptr %10, align 8, !tbaa !5
  br label %49, !llvm.loop !22

67:                                               ; preds = %57
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.vertexT, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  store ptr %70, ptr %12, align 8, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = call i32 @qh_pointid(ptr noundef %71, ptr noundef %72)
  store i32 %73, ptr %14, align 4, !tbaa !26
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  call void @qh_delvertex(ptr noundef %74, ptr noundef %75)
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_resetlists(ptr noundef %76, i32 noundef 0, i32 noundef 1)
  %77 = load i32, ptr %15, align 4, !tbaa !26
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %97

79:                                               ; preds = %67
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.qhT, ptr %80, i32 0, i32 258
  %82 = getelementptr inbounds %struct.qhstatT, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds [249 x %union.intrealT], ptr %82, i64 0, i64 183
  %84 = load i32, ptr %83, align 8, !tbaa !27
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %83, align 8, !tbaa !27
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.facetT, ptr %86, i32 0, i32 15
  %88 = load i32, ptr %87, align 8
  %89 = and i32 %88, -262145
  %90 = or i32 %89, 262144
  store i32 %90, ptr %87, align 8
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.qhT, ptr %94, i32 0, i32 204
  %96 = load i32, ptr %95, align 8, !tbaa !28
  call void @qh_partitioncoplanar(ptr noundef %91, ptr noundef %92, ptr noundef %93, ptr noundef null, i32 noundef %96)
  br label %102

97:                                               ; preds = %67
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load i32, ptr %14, align 4, !tbaa !26
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_all_vertexmerges(ptr noundef %98, i32 noundef %99, ptr noundef %100, ptr noundef %101)
  br label %102

102:                                              ; preds = %97, %79
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_freemergesets(ptr noundef %103)
  store i32 1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %110

104:                                              ; preds = %38
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_freemergesets(ptr noundef %105)
  br label %106

106:                                              ; preds = %104, %4
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_attachnewfacets(ptr noundef %107)
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_makenewplanes(ptr noundef %108)
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_update_vertexneighbors_cone(ptr noundef %109)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %110

110:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %111 = load i32, ptr %5, align 4
  ret i32 %111
}

declare double @qh_matchnewfacets(ptr noundef) #1

declare void @qh_makenewplanes(ptr noundef) #1

declare void @qh_update_vertexneighbors_cone(ptr noundef) #1

declare i32 @qh_getpinchedmerges(ptr noundef, ptr noundef, double noundef, ptr noundef) #1

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

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

declare void @qh_attachnewfacets(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 = !{!"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 = !{!12, !10, i64 1888}
!12 = !{!"qhT", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !10, 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, !10, i64 64, !10, 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, !10, i64 160, !10, i64 168, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !10, i64 192, !10, i64 200, !13, i64 208, !13, i64 212, !10, 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, !10, i64 448, !10, i64 456, !10, 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, !10, 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, !10, 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, !10, i64 1760, !10, i64 1768, !10, i64 1776, !10, i64 1784, !10, i64 1792, !10, i64 1800, !10, i64 1808, !10, i64 1816, !10, i64 1824, !10, i64 1832, !10, i64 1840, !10, i64 1848, !10, i64 1856, !10, i64 1864, !6, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !10, 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, !14, 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, !10, i64 2664, !13, i64 2672, !10, i64 2680, !10, i64 2688, !10, i64 2696, !13, i64 2704, !13, i64 2708, !13, i64 2712, !13, i64 2716, !13, i64 2720, !10, i64 2728, !10, i64 2736, !13, i64 2744, !13, i64 2748, !13, i64 2752, !13, i64 2756, !13, i64 2760, !13, i64 2764, !10, i64 2768, !10, 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, !10, i64 2920, !10, i64 2928, !10, i64 2936, !10, i64 2944, !13, i64 2952, !13, i64 2956, !13, i64 2960, !13, i64 2964, !13, i64 2968, !13, i64 2972, !6, i64 2976, !13, i64 2984, !13, i64 2988, !7, i64 2992, !7, i64 3192, !13, i64 3232, !10, i64 3240, !6, i64 3248, !6, i64 3256, !6, i64 3264, !15, i64 3272, !16, i64 3424}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"qhmemT", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !13, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144}
!16 = !{!"qhstatT", !7, i64 0, !7, i64 1992, !7, i64 2256, !7, i64 4248, !7, i64 4746, !7, i64 4995, !7, i64 5248, !13, i64 5320, !13, i64 5324, !13, i64 5328, !13, i64 5332, !10, i64 5336}
!17 = !{!12, !13, i64 136}
!18 = !{!12, !13, i64 2568}
!19 = !{!12, !6, i64 2480}
!20 = !{!21, !6, i64 56}
!21 = !{!"facetT", !10, i64 0, !10, i64 8, !10, 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}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !6, i64 16}
!25 = !{!"vertexT", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 40, !13, i64 40, !13, i64 40, !13, i64 40, !13, i64 40}
!26 = !{!13, !13, i64 0}
!27 = !{!7, !7, i64 0}
!28 = !{!12, !13, i64 2712}


; 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 @qh_initmergesets(ptr noundef) local_unnamed_addr #1

declare void @qh_resetlists(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @qh_all_vertexmerges(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @qh_freemergesets(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 i32 @qh_pointid(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @qh_printlists(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @qh_buildcone_mergepinched(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store ptr null, ptr %3, align 8, !tbaa !5
  %6 = tail call double @qh_matchnewfacets(ptr noundef %0) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 1888
  %8 = load double, ptr %7, align 8, !tbaa !9
  %9 = fmul double %8, 4.000000e+00
  %10 = fcmp ogt double %6, %9
  br i1 %10, label %11, label %46

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 136
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = icmp sgt i32 %13, 3
  br i1 %14, label %15, label %20

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 2568
  %17 = load i32, ptr %16, align 8, !tbaa !17
  %18 = icmp slt i32 %17, 1000
  br i1 %18, label %19, label %20

19:                                               ; preds = %15
  tail call void @qh_printlists(ptr noundef nonnull %0) #3
  br label %20

20:                                               ; preds = %19, %15, %11
  tail call void @qh_initmergesets(ptr noundef nonnull %0) #3
  %21 = call i32 @qh_getpinchedmerges(ptr noundef nonnull %0, ptr noundef %1, double noundef %6, ptr noundef nonnull %5) #3
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %45, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 2480
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %.not4245 = icmp eq ptr %24, null
  br i1 %.not4245, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %22
  %25 = getelementptr inbounds i8, ptr %24, i64 56
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %.not4348 = icmp eq ptr %26, null
  br i1 %.not4348, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %27 = phi ptr [ %29, %.lr.ph ], [ %26, %.lr.ph.preheader ]
  %.0394649 = phi ptr [ %27, %.lr.ph ], [ %24, %.lr.ph.preheader ]
  call void @qh_delfacet(ptr noundef %0, ptr noundef nonnull %.0394649) #3
  %28 = getelementptr inbounds i8, ptr %27, i64 56
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %.not43 = icmp eq ptr %29, null
  br i1 %.not43, label %.critedge, label %.lr.ph

.critedge:                                        ; preds = %.lr.ph, %.lr.ph.preheader, %22
  %30 = getelementptr inbounds i8, ptr %1, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = call i32 @qh_pointid(ptr noundef %0, ptr noundef %31) #3
  call void @qh_delvertex(ptr noundef %0, ptr noundef %1) #3
  call void @qh_resetlists(ptr noundef %0, i32 noundef 0, i32 noundef 1) #3
  %33 = load i32, ptr %5, align 4, !tbaa !23
  %.not44 = icmp eq i32 %33, 0
  br i1 %.not44, label %43, label %34

34:                                               ; preds = %.critedge
  %35 = getelementptr inbounds i8, ptr %0, i64 4888
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %2, i64 112
  %39 = load i32, ptr %38, align 8
  %40 = or i32 %39, 262144
  store i32 %40, ptr %38, align 8
  %41 = getelementptr inbounds i8, ptr %0, i64 2712
  %42 = load i32, ptr %41, align 8, !tbaa !25
  call void @qh_partitioncoplanar(ptr noundef %0, ptr noundef %31, ptr noundef %2, ptr noundef null, i32 noundef %42)
  br label %44

43:                                               ; preds = %.critedge
  call void @qh_all_vertexmerges(ptr noundef %0, i32 noundef %32, ptr noundef %2, ptr noundef nonnull %3) #3
  br label %44

44:                                               ; preds = %43, %34
  call void @qh_freemergesets(ptr noundef %0) #3
  br label %47

45:                                               ; preds = %20
  call void @qh_freemergesets(ptr noundef nonnull %0) #3
  br label %46

46:                                               ; preds = %45, %4
  call void @qh_attachnewfacets(ptr noundef nonnull %0) #3
  call void @qh_makenewplanes(ptr noundef nonnull %0) #3
  call void @qh_update_vertexneighbors_cone(ptr noundef nonnull %0) #3
  br label %47

47:                                               ; preds = %46, %44
  %.0 = phi i32 [ 1, %44 ], [ 0, %46 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret i32 %.0
}

declare double @qh_matchnewfacets(ptr noundef) local_unnamed_addr #1

declare void @qh_makenewplanes(ptr noundef) local_unnamed_addr #1

declare void @qh_update_vertexneighbors_cone(ptr noundef) local_unnamed_addr #1

declare i32 @qh_getpinchedmerges(ptr noundef, ptr noundef, double noundef, ptr noundef) local_unnamed_addr #1

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

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

declare void @qh_attachnewfacets(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 = !{!10, !12, i64 1888}
!10 = !{!"qhT", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !12, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !6, i64 104, !11, i64 112, !11, i64 116, !6, i64 120, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !12, i64 160, !12, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !12, i64 192, !12, i64 200, !11, i64 208, !11, i64 212, !12, i64 216, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !11, i64 292, !11, i64 296, !7, i64 300, !11, i64 416, !11, i64 420, !11, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !11, i64 440, !11, i64 444, !12, i64 448, !12, i64 456, !12, i64 464, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !11, i64 520, !11, i64 524, !11, i64 528, !11, i64 532, !11, i64 536, !11, i64 540, !11, i64 544, !12, i64 552, !11, i64 560, !11, i64 564, !11, i64 568, !11, i64 572, !11, i64 576, !11, i64 580, !11, i64 584, !11, i64 588, !12, i64 592, !11, i64 600, !6, i64 608, !6, i64 616, !11, i64 624, !11, i64 628, !11, i64 632, !11, i64 636, !11, i64 640, !6, i64 648, !11, i64 656, !6, i64 664, !11, i64 672, !7, i64 676, !11, i64 932, !7, i64 936, !7, i64 1192, !11, i64 1704, !11, i64 1708, !11, i64 1712, !11, i64 1716, !11, i64 1720, !11, 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, !11, 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, !11, i64 2440, !11, i64 2444, !11, i64 2448, !6, i64 2456, !6, i64 2464, !6, i64 2472, !6, i64 2480, !6, i64 2488, !11, i64 2496, !11, i64 2500, !6, i64 2504, !11, i64 2512, !6, i64 2520, !11, i64 2528, !6, i64 2536, !6, i64 2544, !6, i64 2552, !6, i64 2560, !11, i64 2568, !11, i64 2572, !11, i64 2576, !11, i64 2580, !11, i64 2584, !11, i64 2588, !11, i64 2592, !11, i64 2596, !13, i64 2600, !11, i64 2608, !11, i64 2612, !11, i64 2616, !11, i64 2620, !11, i64 2624, !6, i64 2632, !6, i64 2640, !11, i64 2648, !11, i64 2652, !11, i64 2656, !12, i64 2664, !11, i64 2672, !12, i64 2680, !12, i64 2688, !12, i64 2696, !11, i64 2704, !11, i64 2708, !11, i64 2712, !11, i64 2716, !11, i64 2720, !12, i64 2728, !12, i64 2736, !11, i64 2744, !11, i64 2748, !11, i64 2752, !11, i64 2756, !11, i64 2760, !11, i64 2764, !12, i64 2768, !12, i64 2776, !11, i64 2784, !11, i64 2788, !11, i64 2792, !11, 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, !11, i64 2872, !6, i64 2880, !6, i64 2888, !11, i64 2896, !11, i64 2900, !11, i64 2904, !6, i64 2912, !12, i64 2920, !12, i64 2928, !12, i64 2936, !12, i64 2944, !11, i64 2952, !11, i64 2956, !11, i64 2960, !11, i64 2964, !11, i64 2968, !11, i64 2972, !6, i64 2976, !11, i64 2984, !11, i64 2988, !7, i64 2992, !7, i64 3192, !11, i64 3232, !12, i64 3240, !6, i64 3248, !6, i64 3256, !6, i64 3264, !14, i64 3272, !15, i64 3424}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"qhmemT", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144}
!15 = !{!"qhstatT", !7, i64 0, !7, i64 1992, !7, i64 2256, !7, i64 4248, !7, i64 4746, !7, i64 4995, !7, i64 5248, !11, i64 5320, !11, i64 5324, !11, i64 5328, !11, i64 5332, !12, i64 5336}
!16 = !{!10, !11, i64 136}
!17 = !{!10, !11, i64 2568}
!18 = !{!10, !6, i64 2480}
!19 = !{!20, !6, i64 56}
!20 = !{!"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, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115}
!21 = !{!22, !6, i64 16}
!22 = !{!"vertexT", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 40, !11, i64 40, !11, i64 40, !11, i64 40, !11, i64 40}
!23 = !{!11, !11, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !11, i64 2712}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass