; LLVM IR from Discngine/fpocket :: src/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, double, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, double, double, i32, double, i32, 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, i32, double, double, double, 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, i32, ptr, double, double, double, double, [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, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, ptr, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, double, double, i32, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, double, double, double, 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 { [227 x %union.intrealT], [237 x i8], [227 x ptr], [227 x i16], [227 x i8], [227 x i8], [9 x %union.intrealT], i32, i32, i32, i32, double }
%union.intrealT = type { double }
%struct.vertexT = type { ptr, ptr, ptr, ptr, i32, i32, i8 }
%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 = external hidden unnamed_addr constant [76 x i8], align 1
@qh_qhstat = external global %struct.qhstatT, align 8

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

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

15:                                               ; preds = %12
  store i32 1, ptr %9, align 4
  br label %106

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

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

28:                                               ; preds = %19
  %29 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  %30 = getelementptr inbounds %struct.facetT, ptr %29, i32 0, i32 14
  %31 = load i32, ptr %30, align 4, !tbaa !21
  br label %33

32:                                               ; preds = %19
  br label %33

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

35:                                               ; preds = %33, %16
  %36 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 24), align 8, !tbaa !16
  %37 = icmp sge i32 %36, 4
  br i1 %37, label %38, label %42

38:                                               ; preds = %35
  %39 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 169), align 8, !tbaa !23
  %40 = icmp slt i32 %39, 50
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  call void @qh_printlists()
  br label %42

42:                                               ; preds = %41, %38, %35
  %43 = load double, ptr %5, align 8, !tbaa !9
  store double %43, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 126), align 8, !tbaa !24
  %44 = load double, ptr %6, align 8, !tbaa !9
  store double %44, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 127), align 8, !tbaa !25
  %45 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 155), align 8, !tbaa !26
  %46 = call ptr @qh_settemp(i32 noundef %45)
  store ptr %46, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 206), align 8, !tbaa !27
  %47 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 155), align 8, !tbaa !26
  %48 = call ptr @qh_settemp(i32 noundef %47)
  store ptr %48, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 205), align 8, !tbaa !28
  %49 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 104), align 8, !tbaa !29
  %50 = icmp sge i32 %49, 3
  br i1 %50, label %51, label %91

51:                                               ; preds = %42
  %52 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  call void @qh_mark_dupridges(ptr noundef %52)
  %53 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  call void @qh_mergecycle_all(ptr noundef %53, ptr noundef %7)
  call void @qh_forcedmerges(ptr noundef %7)
  %54 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  store ptr %54, ptr %8, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %82, %51
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %63

58:                                               ; preds = %55
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.facetT, ptr %59, i32 0, i32 7
  %61 = load ptr, ptr %60, align 8, !tbaa !30
  %62 = icmp ne ptr %61, null
  br label %63

63:                                               ; preds = %58, %55
  %64 = phi i1 [ false, %55 ], [ %62, %58 ]
  br i1 %64, label %65, label %86

65:                                               ; preds = %63
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.facetT, ptr %66, i32 0, i32 15
  %68 = load i32, ptr %67, align 8
  %69 = lshr i32 %68, 13
  %70 = and i32 %69, 1
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %81, label %72

72:                                               ; preds = %65
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.facetT, ptr %73, i32 0, i32 15
  %75 = load i32, ptr %74, align 8
  %76 = lshr i32 %75, 22
  %77 = and i32 %76, 1
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %81, label %79

79:                                               ; preds = %72
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  call void @qh_degen_redundant_neighbors(ptr noundef %80, ptr noundef null)
  br label %81

81:                                               ; preds = %79, %72, %65
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.facetT, ptr %83, i32 0, i32 7
  %85 = load ptr, ptr %84, align 8, !tbaa !30
  store ptr %85, ptr %8, align 8, !tbaa !5
  br label %55, !llvm.loop !31

86:                                               ; preds = %63
  %87 = call i32 @qh_merge_degenredundant()
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %86
  store i32 1, ptr %7, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %89, %86
  br label %93

91:                                               ; preds = %42
  %92 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  call void @qh_mergecycle_all(ptr noundef %92, ptr noundef %7)
  br label %93

93:                                               ; preds = %91, %90
  %94 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  call void @qh_flippedmerges(ptr noundef %94, ptr noundef %7)
  %95 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 31), align 8, !tbaa !33
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load i32, ptr getelementptr inbounds ([227 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 199), align 8, !tbaa !34
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %105

100:                                              ; preds = %97, %93
  %101 = load i32, ptr getelementptr inbounds ([227 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 173), align 8, !tbaa !34
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr getelementptr inbounds ([227 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 173), align 8, !tbaa !34
  store i32 0, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 195), align 8, !tbaa !35
  %103 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 159), align 8, !tbaa !20
  call void @qh_getmergeset_initial(ptr noundef %103)
  %104 = load i32, ptr %7, align 4, !tbaa !11
  call void @qh_all_merges(i32 noundef %104, i32 noundef 0)
  br label %105

105:                                              ; preds = %100, %97
  call void @qh_settempfree(ptr noundef getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 205))
  call void @qh_settempfree(ptr noundef getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 206))
  store i32 0, ptr %9, align 4
  br label %106

106:                                              ; preds = %105, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %107 = load i32, ptr %9, align 4
  switch i32 %107, label %109 [
    i32 0, label %108
    i32 1, label %108
  ]

108:                                              ; preds = %106, %106
  ret void

109:                                              ; preds = %106
  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

declare ptr @qh_settemp(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @qh_mark_dupridges(ptr 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_degen_redundant_neighbors(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @qh_merge_degenredundant() #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

declare void @qh_settempfree(ptr noundef) #2

; 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 = !{!"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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 1716}
!14 = !{!"qhT", !12, i64 0, !12, i64 4, !12, i64 8, !10, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !10, i64 56, !10, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !6, i64 96, !12, i64 104, !12, i64 108, !6, i64 112, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !10, i64 152, !10, i64 160, !12, i64 168, !12, i64 172, !12, i64 176, !10, i64 184, !10, i64 192, !12, i64 200, !10, i64 208, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !12, i64 236, !12, i64 240, !12, i64 244, !12, i64 248, !12, i64 252, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !12, i64 288, !12, i64 292, !7, i64 296, !12, i64 412, !12, i64 416, !12, i64 420, !12, i64 424, !12, i64 428, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !10, i64 448, !10, i64 456, !10, i64 464, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !12, i64 512, !12, i64 516, !12, i64 520, !12, i64 524, !12, i64 528, !12, i64 532, !12, i64 536, !12, i64 540, !10, i64 544, !12, i64 552, !12, i64 556, !12, i64 560, !12, i64 564, !12, i64 568, !12, i64 572, !12, i64 576, !12, i64 580, !10, i64 584, !12, i64 592, !6, i64 600, !6, i64 608, !12, i64 616, !12, i64 620, !12, i64 624, !12, i64 628, !12, i64 632, !6, i64 640, !12, i64 648, !6, i64 656, !12, i64 664, !7, i64 668, !12, i64 924, !7, i64 928, !7, i64 1184, !12, i64 1696, !12, i64 1700, !12, i64 1704, !12, i64 1708, !12, i64 1712, !12, i64 1716, !6, i64 1720, !6, i64 1728, !6, i64 1736, !6, i64 1744, !10, 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, !12, i64 1856, !6, i64 1864, !10, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !7, i64 1904, !7, i64 1912, !7, i64 2112, !7, i64 2152, !7, i64 2352, !6, i64 2392, !6, i64 2400, !6, i64 2408, !6, i64 2416, !12, i64 2424, !12, i64 2428, !12, i64 2432, !6, i64 2440, !6, i64 2448, !6, i64 2456, !6, i64 2464, !6, i64 2472, !12, i64 2480, !12, i64 2484, !6, i64 2488, !12, i64 2496, !6, i64 2504, !6, i64 2512, !6, i64 2520, !6, i64 2528, !12, i64 2536, !12, i64 2540, !12, i64 2544, !12, i64 2548, !12, i64 2552, !12, i64 2556, !12, i64 2560, !15, i64 2568, !12, i64 2576, !12, i64 2580, !12, i64 2584, !12, i64 2588, !6, i64 2592, !12, i64 2600, !12, i64 2604, !10, i64 2608, !12, i64 2616, !10, i64 2624, !10, i64 2632, !10, i64 2640, !12, i64 2648, !12, i64 2652, !12, i64 2656, !12, i64 2660, !10, i64 2664, !10, i64 2672, !12, i64 2680, !12, i64 2684, !12, i64 2688, !12, i64 2692, !10, i64 2696, !10, i64 2704, !12, i64 2712, !12, i64 2716, !12, i64 2720, !12, i64 2724, !6, i64 2728, !6, i64 2736, !6, i64 2744, !6, i64 2752, !6, i64 2760, !6, i64 2768, !6, i64 2776, !6, i64 2784, !12, i64 2792, !6, i64 2800, !6, i64 2808, !12, i64 2816, !12, i64 2820, !12, i64 2824, !6, i64 2832, !10, i64 2840, !10, i64 2848, !10, i64 2856, !12, i64 2864, !12, i64 2868, !6, i64 2872, !6, i64 2880, !12, i64 2888}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !12, i64 128}
!17 = !{!14, !6, i64 2408}
!18 = !{!19, !12, i64 32}
!19 = !{!"vertexT", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 40, !12, i64 40, !12, i64 40, !12, i64 40}
!20 = !{!14, !6, i64 2464}
!21 = !{!22, !12, i64 108}
!22 = !{!"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, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 113, !12, i64 113, !12, i64 113, !12, i64 113, !12, i64 113, !12, i64 113, !12, i64 113, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 114, !12, i64 115, !12, i64 115, !12, i64 115, !12, i64 115, !12, i64 115, !12, i64 115, !12, i64 115, !12, i64 115}
!23 = !{!14, !12, i64 2536}
!24 = !{!14, !10, i64 1760}
!25 = !{!14, !10, i64 1768}
!26 = !{!14, !12, i64 2432}
!27 = !{!14, !6, i64 2736}
!28 = !{!14, !6, i64 2728}
!29 = !{!14, !12, i64 624}
!30 = !{!22, !6, i64 56}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!14, !12, i64 168}
!34 = !{!7, !7, i64 0}
!35 = !{!14, !12, i64 2680}


; 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, double, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, double, double, i32, double, i32, 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, i32, double, double, double, 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, i32, ptr, double, double, double, double, [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, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, ptr, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, double, double, i32, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, double, double, double, 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 { [227 x %union.intrealT], [237 x i8], [227 x ptr], [227 x i16], [227 x i8], [227 x i8], [9 x %union.intrealT], i32, i32, i32, i32, double }
%union.intrealT = type { double }

@qh_qh = external global %struct.qhT, align 8
@.str = external hidden unnamed_addr constant [76 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(ptr nocapture noundef readonly %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 1716), 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)
  %.not15 = icmp eq i32 %7, 0
  br i1 %.not15, label %8, label %57

8:                                                ; preds = %6, %3
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 128), 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 2408), align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load i32, ptr %13, align 8, !tbaa !16
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !18
  %.not16 = icmp eq ptr %15, null
  br i1 %.not16, label %19, label %16

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

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

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

.thread:                                          ; preds = %8, %24, %19
  store double %1, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 1760), align 8, !tbaa !21
  store double %2, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 1768), align 8, !tbaa !22
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2432), align 8, !tbaa !23
  %26 = tail call ptr @qh_settemp(i32 noundef %25) #3
  store ptr %26, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2736), align 8, !tbaa !24
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2432), align 8, !tbaa !23
  %28 = tail call ptr @qh_settemp(i32 noundef %27) #3
  store ptr %28, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2728), align 8, !tbaa !25
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 624), align 8, !tbaa !26
  %30 = icmp sgt i32 %29, 2
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !18
  br i1 %30, label %32, label %44

32:                                               ; preds = %.thread
  tail call void @qh_mark_dupridges(ptr noundef %31)
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !18
  call void @qh_mergecycle_all(ptr noundef %33, ptr noundef nonnull %4)
  call void @qh_forcedmerges(ptr noundef nonnull %4)
  %.023 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !27
  %.not1724 = icmp eq ptr %.023, null
  br i1 %.not1724, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %32, %41
  %.025 = phi ptr [ %.0, %41 ], [ %.023, %32 ]
  %34 = getelementptr inbounds i8, ptr %.025, i64 56
  %35 = load ptr, ptr %34, align 8, !tbaa !27
  %.not18 = icmp eq ptr %35, null
  br i1 %.not18, label %.critedge, label %36

36:                                               ; preds = %.lr.ph
  %37 = getelementptr inbounds i8, ptr %.025, i64 112
  %38 = load i32, ptr %37, align 8
  %39 = and i32 %38, 4202496
  %or.cond22 = icmp eq i32 %39, 0
  br i1 %or.cond22, label %40, label %41

40:                                               ; preds = %36
  call void @qh_degen_redundant_neighbors(ptr noundef nonnull %.025, ptr noundef null)
  %.0.pre = load ptr, ptr %34, align 8, !tbaa !27
  br label %41

41:                                               ; preds = %36, %40
  %.0 = phi ptr [ %35, %36 ], [ %.0.pre, %40 ]
  %.not17 = icmp eq ptr %.0, null
  br i1 %.not17, label %.critedge, label %.lr.ph, !llvm.loop !28

.critedge:                                        ; preds = %.lr.ph, %41, %32
  %42 = call i32 @qh_merge_degenredundant()
  %.not19 = icmp eq i32 %42, 0
  br i1 %.not19, label %45, label %43

43:                                               ; preds = %.critedge
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %45

44:                                               ; preds = %.thread
  call void @qh_mergecycle_all(ptr noundef %31, ptr noundef nonnull %4)
  br label %45

45:                                               ; preds = %.critedge, %43, %44
  %46 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !18
  call void @qh_flippedmerges(ptr noundef %46, ptr noundef nonnull %4)
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 168), align 8, !tbaa !30
  %48 = icmp eq i32 %47, 0
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1592), align 8
  %50 = icmp ne i32 %49, 0
  %or.cond3 = select i1 %48, i1 true, i1 %50
  br i1 %or.cond3, label %51, label %56

51:                                               ; preds = %45
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1384), align 8, !tbaa !31
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 1384), align 8, !tbaa !31
  store i32 0, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2680), align 8, !tbaa !32
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2464), align 8, !tbaa !18
  call void @qh_getmergeset_initial(ptr noundef %54)
  %55 = load i32, ptr %4, align 4, !tbaa !5
  call void @qh_all_merges(i32 noundef %55, i32 noundef 0)
  br label %56

56:                                               ; preds = %45, %51
  call void @qh_settempfree(ptr noundef nonnull getelementptr inbounds (i8, ptr @qh_qh, i64 2728)) #3
  call void @qh_settempfree(ptr noundef nonnull getelementptr inbounds (i8, ptr @qh_qh, i64 2736)) #3
  br label %57

57:                                               ; preds = %6, %56
  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

declare ptr @qh_settemp(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @qh_mark_dupridges(ptr 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_degen_redundant_neighbors(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @qh_merge_degenredundant() 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

declare void @qh_settempfree(ptr noundef) local_unnamed_addr #2

; 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 1716}
!10 = !{!"qhT", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !11, i64 56, !11, i64 64, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 108, !12, i64 112, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !11, i64 152, !11, i64 160, !6, i64 168, !6, i64 172, !6, i64 176, !11, i64 184, !11, i64 192, !6, i64 200, !11, i64 208, !6, i64 216, !6, i64 220, !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, !7, i64 296, !6, i64 412, !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, !11, i64 544, !6, i64 552, !6, i64 556, !6, i64 560, !6, i64 564, !6, i64 568, !6, i64 572, !6, i64 576, !6, i64 580, !11, i64 584, !6, i64 592, !12, i64 600, !12, i64 608, !6, i64 616, !6, i64 620, !6, i64 624, !6, i64 628, !6, i64 632, !12, i64 640, !6, i64 648, !12, i64 656, !6, i64 664, !7, i64 668, !6, i64 924, !7, i64 928, !7, i64 1184, !6, i64 1696, !6, i64 1700, !6, i64 1704, !6, i64 1708, !6, i64 1712, !6, i64 1716, !12, i64 1720, !12, i64 1728, !12, i64 1736, !12, i64 1744, !11, 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, !6, i64 1856, !12, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888, !11, i64 1896, !7, i64 1904, !7, i64 1912, !7, i64 2112, !7, i64 2152, !7, i64 2352, !12, i64 2392, !12, i64 2400, !12, i64 2408, !12, i64 2416, !6, i64 2424, !6, i64 2428, !6, i64 2432, !12, i64 2440, !12, i64 2448, !12, i64 2456, !12, i64 2464, !12, i64 2472, !6, i64 2480, !6, i64 2484, !12, i64 2488, !6, i64 2496, !12, i64 2504, !12, i64 2512, !12, i64 2520, !12, i64 2528, !6, i64 2536, !6, i64 2540, !6, i64 2544, !6, i64 2548, !6, i64 2552, !6, i64 2556, !6, i64 2560, !13, i64 2568, !6, i64 2576, !6, i64 2580, !6, i64 2584, !6, i64 2588, !12, i64 2592, !6, i64 2600, !6, i64 2604, !11, i64 2608, !6, i64 2616, !11, i64 2624, !11, i64 2632, !11, i64 2640, !6, i64 2648, !6, i64 2652, !6, i64 2656, !6, i64 2660, !11, i64 2664, !11, i64 2672, !6, i64 2680, !6, i64 2684, !6, i64 2688, !6, i64 2692, !11, i64 2696, !11, i64 2704, !6, i64 2712, !6, i64 2716, !6, i64 2720, !6, i64 2724, !12, i64 2728, !12, i64 2736, !12, i64 2744, !12, i64 2752, !12, i64 2760, !12, i64 2768, !12, i64 2776, !12, i64 2784, !6, i64 2792, !12, i64 2800, !12, i64 2808, !6, i64 2816, !6, i64 2820, !6, i64 2824, !12, i64 2832, !11, i64 2840, !11, i64 2848, !11, i64 2856, !6, i64 2864, !6, i64 2868, !12, i64 2872, !12, i64 2880, !6, i64 2888}
!11 = !{!"double", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !6, i64 128}
!15 = !{!10, !12, i64 2408}
!16 = !{!17, !6, i64 32}
!17 = !{!"vertexT", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 40, !6, i64 40, !6, i64 40, !6, i64 40}
!18 = !{!10, !12, i64 2464}
!19 = !{!20, !6, i64 108}
!20 = !{!"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}
!21 = !{!10, !11, i64 1760}
!22 = !{!10, !11, i64 1768}
!23 = !{!10, !6, i64 2432}
!24 = !{!10, !12, i64 2736}
!25 = !{!10, !12, i64 2728}
!26 = !{!10, !6, i64 624}
!27 = !{!12, !12, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!10, !6, i64 168}
!31 = !{!7, !7, i64 0}
!32 = !{!10, !6, i64 2680}


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