; 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
@.str.14 = external hidden unnamed_addr constant [80 x i8], align 1
@qh_qhstat = external global %struct.qhstatT, align 8

; Function Attrs: nounwind uwtable
define dso_local void @qh_premerge(i32 noundef %0, double noundef %1, double noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store double %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  %9 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 126), align 4, !tbaa !11
  %10 = icmp ne i32 %9, 0
  br i1 %10, label %11, label %15

11:                                               ; preds = %3
  %12 = call i32 @qh_checkzero(i32 noundef 0)
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  store i32 1, ptr %8, align 4
  br label %62

15:                                               ; preds = %11, %3
  %16 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 29), align 8, !tbaa !15
  %17 = icmp sge i32 %16, 2
  br i1 %17, label %18, label %32

18:                                               ; preds = %15
  %19 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 158), align 8, !tbaa !16
  %20 = load double, ptr %5, align 8, !tbaa !9
  %21 = load double, ptr %6, align 8, !tbaa !9
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %29

25:                                               ; preds = %18
  %26 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  %27 = getelementptr inbounds %struct.facetT, ptr %26, i32 0, i32 14
  %28 = load i32, ptr %27, align 4, !tbaa !18
  br label %30

29:                                               ; preds = %18
  br label %30

30:                                               ; preds = %29, %25
  %31 = phi i32 [ %28, %25 ], [ -1, %29 ]
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %19, i32 noundef 2008, ptr noundef @.str.14, double noundef %20, double noundef %21, i32 noundef %22, i32 noundef %31)
  br label %32

32:                                               ; preds = %30, %15
  %33 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 29), align 8, !tbaa !15
  %34 = icmp sge i32 %33, 4
  br i1 %34, label %35, label %39

35:                                               ; preds = %32
  %36 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 178), align 8, !tbaa !20
  %37 = icmp slt i32 %36, 100
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  call void @qh_printlists()
  br label %39

39:                                               ; preds = %38, %35, %32
  %40 = load double, ptr %5, align 8, !tbaa !9
  store double %40, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 132), align 8, !tbaa !21
  %41 = load double, ptr %6, align 8, !tbaa !9
  store double %41, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 133), align 8, !tbaa !22
  %42 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 110), align 8, !tbaa !23
  %43 = icmp sge i32 %42, 3
  br i1 %43, label %44, label %47

44:                                               ; preds = %39
  %45 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  call void @qh_mark_dupridges(ptr noundef %45, i32 noundef 1)
  %46 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  call void @qh_mergecycle_all(ptr noundef %46, ptr noundef %7)
  call void @qh_forcedmerges(ptr noundef %7)
  br label %49

47:                                               ; preds = %39
  %48 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  call void @qh_mergecycle_all(ptr noundef %48, ptr noundef %7)
  br label %49

49:                                               ; preds = %47, %44
  %50 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  call void @qh_flippedmerges(ptr noundef %50, ptr noundef %7)
  %51 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 37), align 4, !tbaa !24
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %56

53:                                               ; preds = %49
  %54 = load i32, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 216), align 8, !tbaa !25
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %61

56:                                               ; preds = %53, %49
  %57 = load i32, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 186), align 8, !tbaa !25
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 186), align 8, !tbaa !25
  store i32 0, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 209), align 8, !tbaa !26
  %59 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 166), align 8, !tbaa !17
  call void @qh_getmergeset_initial(ptr noundef %59)
  %60 = load i32, ptr %7, align 4, !tbaa !5
  call void @qh_all_merges(i32 noundef %60, i32 noundef 0)
  br label %61

61:                                               ; preds = %56, %53
  store i32 0, ptr %8, align 4
  br label %62

62:                                               ; preds = %61, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %63 = load i32, ptr %8, align 4
  switch i32 %63, label %65 [
    i32 0, label %64
    i32 1, label %64
  ]

64:                                               ; preds = %62, %62
  ret void

65:                                               ; preds = %62
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @qh_checkzero(i32 noundef) #0

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

declare void @qh_printlists() #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @qh_mergecycle_all(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_forcedmerges(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_flippedmerges(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_getmergeset_initial(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_all_merges(i32 noundef, i32 noundef) #0

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 1724}
!12 = !{!"qhT", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !10, 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, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !13, i64 104, !6, i64 112, !6, i64 116, !13, i64 120, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !10, i64 160, !10, i64 168, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !10, i64 192, !10, i64 200, !6, i64 208, !6, i64 212, !10, 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, !10, i64 448, !10, i64 456, !10, 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, !10, 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, !10, i64 592, !6, i64 600, !13, i64 608, !13, i64 616, !6, i64 624, !6, i64 628, !6, i64 632, !6, i64 636, !6, i64 640, !13, i64 648, !6, i64 656, !13, 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, !13, i64 1728, !13, i64 1736, !13, i64 1744, !13, 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, !13, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !10, i64 1904, !6, i64 1912, !7, i64 1916, !7, i64 1928, !7, i64 2128, !7, i64 2168, !7, i64 2368, !13, i64 2408, !13, i64 2416, !13, i64 2424, !13, i64 2432, !6, i64 2440, !6, i64 2444, !6, i64 2448, !13, i64 2456, !13, i64 2464, !13, i64 2472, !13, i64 2480, !13, i64 2488, !6, i64 2496, !6, i64 2500, !13, i64 2504, !6, i64 2512, !13, i64 2520, !6, i64 2528, !13, i64 2536, !13, i64 2544, !13, i64 2552, !13, 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, !14, i64 2600, !6, i64 2608, !6, i64 2612, !6, i64 2616, !6, i64 2620, !6, i64 2624, !13, i64 2632, !13, i64 2640, !6, i64 2648, !6, i64 2652, !6, i64 2656, !10, i64 2664, !6, i64 2672, !10, i64 2680, !10, i64 2688, !10, i64 2696, !6, i64 2704, !6, i64 2708, !6, i64 2712, !6, i64 2716, !6, i64 2720, !10, i64 2728, !10, i64 2736, !6, i64 2744, !6, i64 2748, !6, i64 2752, !6, i64 2756, !6, i64 2760, !6, i64 2764, !10, i64 2768, !10, i64 2776, !6, i64 2784, !6, i64 2788, !6, i64 2792, !6, i64 2796, !13, i64 2800, !13, i64 2808, !13, i64 2816, !13, i64 2824, !13, i64 2832, !13, i64 2840, !13, i64 2848, !13, i64 2856, !13, i64 2864, !6, i64 2872, !13, i64 2880, !13, i64 2888, !6, i64 2896, !6, i64 2900, !6, i64 2904, !13, i64 2912, !10, i64 2920, !10, i64 2928, !10, i64 2936, !10, i64 2944, !6, i64 2952, !6, i64 2956, !6, i64 2960, !6, i64 2964, !6, i64 2968, !6, i64 2972, !13, i64 2976, !13, i64 2984, !6, i64 2992}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 136}
!16 = !{!12, !13, i64 2424}
!17 = !{!12, !13, i64 2480}
!18 = !{!19, !6, i64 108}
!19 = !{!"facetT", !10, i64 0, !10, i64 8, !10, i64 16, !13, i64 24, !7, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, 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}
!20 = !{!12, !6, i64 2568}
!21 = !{!12, !10, i64 1768}
!22 = !{!12, !10, i64 1776}
!23 = !{!12, !6, i64 632}
!24 = !{!12, !6, i64 180}
!25 = !{!7, !7, i64 0}
!26 = !{!12, !6, i64 2744}


; 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
@.str.14 = external hidden unnamed_addr constant [80 x i8], align 1
@qh_qhstat = external local_unnamed_addr global %struct.qhstatT, align 8

; Function Attrs: nounwind uwtable
define dso_local void @qh_premerge(i32 noundef %0, double noundef %1, double noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 1724), align 4, !tbaa !9
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %8, label %6

6:                                                ; preds = %3
  %7 = tail call i32 @qh_checkzero(i32 noundef 0)
  %.not7 = icmp eq i32 %7, 0
  br i1 %.not7, label %8, label %40

8:                                                ; preds = %6, %3
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 136), align 8, !tbaa !14
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %11, label %.thread

11:                                               ; preds = %8
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2424), align 8, !tbaa !15
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2480), align 8, !tbaa !16
  %.not8 = icmp eq ptr %13, null
  br i1 %.not8, label %17, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %13, i64 108
  %16 = load i32, ptr %15, align 4, !tbaa !17
  br label %17

17:                                               ; preds = %14, %11
  %18 = phi i32 [ %16, %14 ], [ -1, %11 ]
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %12, i32 noundef 2008, ptr noundef nonnull @.str.14, double noundef %1, double noundef %2, i32 noundef %0, i32 noundef %18) #3
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 136), align 8, !tbaa !14
  %19 = icmp sgt i32 %.pre, 3
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2568), align 8
  %21 = icmp slt i32 %20, 100
  %or.cond = select i1 %19, i1 %21, i1 false
  br i1 %or.cond, label %22, label %.thread

22:                                               ; preds = %17
  tail call void @qh_printlists() #3
  br label %.thread

.thread:                                          ; preds = %8, %22, %17
  store double %1, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 1768), align 8, !tbaa !19
  store double %2, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 1776), align 8, !tbaa !20
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 632), align 8, !tbaa !21
  %24 = icmp sgt i32 %23, 2
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2480), align 8, !tbaa !16
  br i1 %24, label %26, label %28

26:                                               ; preds = %.thread
  tail call void @qh_mark_dupridges(ptr noundef %25, i32 noundef 1)
  %27 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2480), align 8, !tbaa !16
  call void @qh_mergecycle_all(ptr noundef %27, ptr noundef nonnull %4)
  call void @qh_forcedmerges(ptr noundef nonnull %4)
  br label %29

28:                                               ; preds = %.thread
  call void @qh_mergecycle_all(ptr noundef %25, ptr noundef nonnull %4)
  br label %29

29:                                               ; preds = %28, %26
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2480), align 8, !tbaa !16
  call void @qh_flippedmerges(ptr noundef %30, ptr noundef nonnull %4)
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 180), align 4, !tbaa !22
  %32 = icmp eq i32 %31, 0
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1728), align 8
  %34 = icmp ne i32 %33, 0
  %or.cond3 = select i1 %32, i1 true, i1 %34
  br i1 %or.cond3, label %35, label %40

35:                                               ; preds = %29
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1488), align 8, !tbaa !23
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1488), align 8, !tbaa !23
  store i32 0, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2744), align 8, !tbaa !24
  %38 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2480), align 8, !tbaa !16
  call void @qh_getmergeset_initial(ptr noundef %38)
  %39 = load i32, ptr %4, align 4, !tbaa !5
  call void @qh_all_merges(i32 noundef %39, i32 noundef 0)
  br label %40

40:                                               ; preds = %35, %29, %6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @qh_checkzero(i32 noundef) local_unnamed_addr #0

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

declare void @qh_printlists() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @qh_mergecycle_all(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_forcedmerges(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_flippedmerges(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_getmergeset_initial(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_all_merges(i32 noundef, i32 noundef) local_unnamed_addr #0

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !6, i64 1724}
!10 = !{!"qhT", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !11, 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, !11, i64 64, !11, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !12, i64 104, !6, i64 112, !6, i64 116, !12, i64 120, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !11, i64 160, !11, i64 168, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !11, i64 192, !11, i64 200, !6, i64 208, !6, i64 212, !11, 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, !11, i64 448, !11, i64 456, !11, 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, !11, 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, !11, i64 592, !6, i64 600, !12, i64 608, !12, i64 616, !6, i64 624, !6, i64 628, !6, i64 632, !6, i64 636, !6, i64 640, !12, i64 648, !6, i64 656, !12, 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, !12, i64 1728, !12, i64 1736, !12, i64 1744, !12, i64 1752, !11, i64 1760, !11, i64 1768, !11, i64 1776, !11, i64 1784, !11, i64 1792, !11, i64 1800, !11, i64 1808, !11, i64 1816, !11, i64 1824, !11, i64 1832, !11, i64 1840, !11, i64 1848, !11, i64 1856, !11, i64 1864, !12, i64 1872, !11, i64 1880, !11, i64 1888, !11, i64 1896, !11, i64 1904, !6, 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, !6, i64 2440, !6, i64 2444, !6, i64 2448, !12, i64 2456, !12, i64 2464, !12, i64 2472, !12, i64 2480, !12, i64 2488, !6, i64 2496, !6, i64 2500, !12, i64 2504, !6, i64 2512, !12, i64 2520, !6, i64 2528, !12, i64 2536, !12, i64 2544, !12, i64 2552, !12, 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, !13, i64 2600, !6, i64 2608, !6, i64 2612, !6, i64 2616, !6, i64 2620, !6, i64 2624, !12, i64 2632, !12, i64 2640, !6, i64 2648, !6, i64 2652, !6, i64 2656, !11, i64 2664, !6, i64 2672, !11, i64 2680, !11, i64 2688, !11, i64 2696, !6, i64 2704, !6, i64 2708, !6, i64 2712, !6, i64 2716, !6, i64 2720, !11, i64 2728, !11, i64 2736, !6, i64 2744, !6, i64 2748, !6, i64 2752, !6, i64 2756, !6, i64 2760, !6, i64 2764, !11, i64 2768, !11, i64 2776, !6, i64 2784, !6, i64 2788, !6, i64 2792, !6, 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, !6, i64 2872, !12, i64 2880, !12, i64 2888, !6, i64 2896, !6, i64 2900, !6, i64 2904, !12, i64 2912, !11, i64 2920, !11, i64 2928, !11, i64 2936, !11, i64 2944, !6, i64 2952, !6, i64 2956, !6, i64 2960, !6, i64 2964, !6, i64 2968, !6, i64 2972, !12, i64 2976, !12, i64 2984, !6, i64 2992}
!11 = !{!"double", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !6, i64 136}
!15 = !{!10, !12, i64 2424}
!16 = !{!10, !12, i64 2480}
!17 = !{!18, !6, i64 108}
!18 = !{!"facetT", !11, i64 0, !11, i64 8, !11, 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, !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}
!19 = !{!10, !11, i64 1768}
!20 = !{!10, !11, i64 1776}
!21 = !{!10, !6, i64 632}
!22 = !{!10, !6, i64 180}
!23 = !{!7, !7, i64 0}
!24 = !{!10, !6, i64 2744}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass