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

; 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.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
@.str.139 = external hidden unnamed_addr constant [79 x i8], align 1

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

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

declare void @qh_fprintf(ptr noundef, i32 noundef, ptr noundef, ...) #1

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

declare i32 @qh_pointid(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @qh_findfacet_all(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %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
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  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 8, ptr %11) #3
  store ptr null, ptr %11, align 8, !tbaa !5
  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
  store i32 0, ptr %14, align 4, !tbaa !9
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  store double 0xFFEFFFFFFFFFFFFF, ptr %15, align 8, !tbaa !11
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !9
  %17 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 163), align 8, !tbaa !13
  store ptr %17, ptr %12, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %79, %5
  %19 = load ptr, ptr %12, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %26

21:                                               ; preds = %18
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.facetT, ptr %22, i32 0, i32 7
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp ne ptr %24, null
  br label %26

26:                                               ; preds = %21, %18
  %27 = phi i1 [ false, %18 ], [ %25, %21 ]
  br i1 %27, label %28, label %83

28:                                               ; preds = %26
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.facetT, ptr %29, i32 0, i32 15
  %31 = load i32, ptr %30, align 8
  %32 = lshr i32 %31, 16
  %33 = and i32 %32, 1
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %47, label %35

35:                                               ; preds = %28
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.facetT, ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %47

40:                                               ; preds = %35
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.facetT, ptr %41, i32 0, i32 15
  %43 = load i32, ptr %42, align 8
  %44 = lshr i32 %43, 11
  %45 = and i32 %44, 1
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %40, %35, %28
  br label %79

48:                                               ; preds = %40
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %59

51:                                               ; preds = %48
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.facetT, ptr %52, i32 0, i32 15
  %54 = load i32, ptr %53, align 8
  %55 = lshr i32 %54, 17
  %56 = and i32 %55, 1
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %51
  br label %79

59:                                               ; preds = %51, %48
  %60 = load i32, ptr %14, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %14, align 4, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  call void @qh_distplane(ptr noundef %62, ptr noundef %63, ptr noundef %13)
  %64 = load double, ptr %13, align 8, !tbaa !11
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = fcmp ogt double %64, %66
  br i1 %67, label %68, label %78

68:                                               ; preds = %59
  %69 = load double, ptr %13, align 8, !tbaa !11
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  store double %69, ptr %70, align 8, !tbaa !11
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %71, ptr %11, align 8, !tbaa !5
  %72 = load double, ptr %13, align 8, !tbaa !11
  %73 = load double, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 6), align 8, !tbaa !19
  %74 = fcmp ogt double %72, %73
  br i1 %74, label %75, label %77

75:                                               ; preds = %68
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %76, align 4, !tbaa !9
  br label %83

77:                                               ; preds = %68
  br label %78

78:                                               ; preds = %77, %59
  br label %79

79:                                               ; preds = %78, %58, %47
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.facetT, ptr %80, i32 0, i32 7
  %82 = load ptr, ptr %81, align 8, !tbaa !16
  store ptr %82, ptr %12, align 8, !tbaa !5
  br label %18, !llvm.loop !20

83:                                               ; preds = %75, %26
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %84, ptr %85, align 4, !tbaa !9
  %86 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 29), align 8, !tbaa !22
  %87 = icmp sge i32 %86, 3
  br i1 %87, label %88, label %107

88:                                               ; preds = %83
  %89 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 158), align 8, !tbaa !23
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = call i32 @qh_pointid(ptr noundef %90)
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %99

95:                                               ; preds = %88
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.facetT, ptr %96, i32 0, i32 14
  %98 = load i32, ptr %97, align 4, !tbaa !24
  br label %100

99:                                               ; preds = %88
  br label %100

100:                                              ; preds = %99, %95
  %101 = phi i32 [ %98, %95 ], [ -1, %99 ]
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = load double, ptr %102, align 8, !tbaa !11
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !9
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %89, i32 noundef 3016, ptr noundef @.str.139, i32 noundef %91, i32 noundef %92, i32 noundef %101, double noundef %103, i32 noundef %105, i32 noundef %106)
  br label %107

107:                                              ; preds = %100, %83
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  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
  ret ptr %108
}

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


; 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] }

@qh_qh = external local_unnamed_addr global %struct.qhT, align 8
@.str.139 = external hidden unnamed_addr constant [79 x i8], align 1

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

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

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

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

declare i32 @qh_pointid(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @qh_findfacet_all(ptr noundef %0, i32 noundef %1, ptr nocapture noundef %2, ptr nocapture noundef %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #2 {
  %6 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store double 0xFFEFFFFFFFFFFFFF, ptr %2, align 8, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !9
  %.02642 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2456), align 8, !tbaa !11
  %.not43 = icmp eq ptr %.02642, null
  br i1 %.not43, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %.not35 = icmp eq i32 %1, 0
  br i1 %.not35, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %25
  %.02646.us = phi ptr [ %.026.us, %25 ], [ %.02642, %.lr.ph ]
  %.045.us = phi i32 [ %.1.us, %25 ], [ 0, %.lr.ph ]
  %.02744.us = phi ptr [ %.128.us, %25 ], [ null, %.lr.ph ]
  %7 = getelementptr inbounds i8, ptr %.02646.us, i64 56
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %.not31.us = icmp eq ptr %8, null
  br i1 %.not31.us, label %.critedge, label %9

9:                                                ; preds = %.lr.ph.split.us
  %10 = getelementptr inbounds i8, ptr %.02646.us, i64 112
  %11 = load i32, ptr %10, align 8
  %12 = and i32 %11, 65536
  %.not32.us = icmp eq i32 %12, 0
  br i1 %.not32.us, label %13, label %25

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %.02646.us, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %.not33.us = icmp ne ptr %15, null
  %16 = and i32 %11, 2048
  %.not34.us = icmp eq i32 %16, 0
  %or.cond.us = and i1 %.not34.us, %.not33.us
  br i1 %or.cond.us, label %17, label %25

17:                                               ; preds = %13
  %18 = add nsw i32 %.045.us, 1
  call void @qh_distplane(ptr noundef %0, ptr noundef nonnull %.02646.us, ptr noundef nonnull %6) #3
  %19 = load double, ptr %6, align 8, !tbaa !5
  %20 = load double, ptr %2, align 8, !tbaa !5
  %21 = fcmp ogt double %19, %20
  br i1 %21, label %22, label %25

22:                                               ; preds = %17
  store double %19, ptr %2, align 8, !tbaa !5
  %23 = load double, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 24), align 8, !tbaa !16
  %24 = fcmp ogt double %19, %23
  br i1 %24, label %.split.us, label %25

25:                                               ; preds = %22, %17, %13, %9
  %.128.us = phi ptr [ %.02744.us, %9 ], [ %.02646.us, %22 ], [ %.02744.us, %17 ], [ %.02744.us, %13 ]
  %.1.us = phi i32 [ %.045.us, %9 ], [ %18, %22 ], [ %18, %17 ], [ %.045.us, %13 ]
  %.026.us = load ptr, ptr %7, align 8, !tbaa !11
  %.not.us = icmp eq ptr %.026.us, null
  br i1 %.not.us, label %.critedge, label %.lr.ph.split.us, !llvm.loop !19

.lr.ph.split:                                     ; preds = %.lr.ph, %45
  %.02646 = phi ptr [ %.026, %45 ], [ %.02642, %.lr.ph ]
  %.045 = phi i32 [ %.1, %45 ], [ 0, %.lr.ph ]
  %.02744 = phi ptr [ %.128, %45 ], [ null, %.lr.ph ]
  %26 = getelementptr inbounds i8, ptr %.02646, i64 56
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %.not31 = icmp eq ptr %27, null
  br i1 %.not31, label %.critedge, label %28

28:                                               ; preds = %.lr.ph.split
  %29 = getelementptr inbounds i8, ptr %.02646, i64 112
  %30 = load i32, ptr %29, align 8
  %31 = and i32 %30, 65536
  %.not32 = icmp eq i32 %31, 0
  br i1 %.not32, label %32, label %45

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %.02646, i64 24
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %.not33 = icmp ne ptr %34, null
  %35 = and i32 %30, 133120
  %36 = icmp eq i32 %35, 0
  %or.cond56 = and i1 %36, %.not33
  br i1 %or.cond56, label %37, label %45

37:                                               ; preds = %32
  %38 = add nsw i32 %.045, 1
  call void @qh_distplane(ptr noundef %0, ptr noundef nonnull %.02646, ptr noundef nonnull %6) #3
  %39 = load double, ptr %6, align 8, !tbaa !5
  %40 = load double, ptr %2, align 8, !tbaa !5
  %41 = fcmp ogt double %39, %40
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  store double %39, ptr %2, align 8, !tbaa !5
  %43 = load double, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 24), align 8, !tbaa !16
  %44 = fcmp ogt double %39, %43
  br i1 %44, label %.split.us, label %45

.split.us:                                        ; preds = %42, %22
  %.us-phi52 = phi i32 [ %18, %22 ], [ %38, %42 ]
  %.us-phi53 = phi ptr [ %.02646.us, %22 ], [ %.02646, %42 ]
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %.critedge

45:                                               ; preds = %37, %42, %28, %32
  %.128 = phi ptr [ %.02744, %28 ], [ %.02646, %42 ], [ %.02744, %37 ], [ %.02744, %32 ]
  %.1 = phi i32 [ %.045, %28 ], [ %38, %42 ], [ %38, %37 ], [ %.045, %32 ]
  %.026 = load ptr, ptr %26, align 8, !tbaa !11
  %.not = icmp eq ptr %.026, null
  br i1 %.not, label %.critedge, label %.lr.ph.split, !llvm.loop !19

.critedge:                                        ; preds = %.lr.ph.split, %45, %.lr.ph.split.us, %25, %5, %.split.us
  %.229 = phi ptr [ %.us-phi53, %.split.us ], [ null, %5 ], [ %.02744.us, %.lr.ph.split.us ], [ %.128.us, %25 ], [ %.02744, %.lr.ph.split ], [ %.128, %45 ]
  %.2 = phi i32 [ %.us-phi52, %.split.us ], [ 0, %5 ], [ %.045.us, %.lr.ph.split.us ], [ %.1.us, %25 ], [ %.045, %.lr.ph.split ], [ %.1, %45 ]
  store i32 %.2, ptr %4, align 4, !tbaa !9
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 136), align 8, !tbaa !21
  %47 = icmp sgt i32 %46, 2
  br i1 %47, label %48, label %58

48:                                               ; preds = %.critedge
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2424), align 8, !tbaa !22
  %50 = call i32 @qh_pointid(ptr noundef %0) #3
  %.not37 = icmp eq ptr %.229, null
  br i1 %.not37, label %54, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %.229, i64 108
  %53 = load i32, ptr %52, align 4, !tbaa !23
  br label %54

54:                                               ; preds = %48, %51
  %55 = phi i32 [ %53, %51 ], [ -1, %48 ]
  %56 = load double, ptr %2, align 8, !tbaa !5
  %57 = load i32, ptr %3, align 4, !tbaa !9
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %49, i32 noundef 3016, ptr noundef nonnull @.str.139, i32 noundef %50, i32 noundef %1, i32 noundef %55, double noundef %56, i32 noundef %57, i32 noundef %.2) #3
  br label %58

58:                                               ; preds = %54, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  ret ptr %.229
}

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass