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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.qhT = type { i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, double, double, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [29 x i32], i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, double, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, [256 x i8], i32, [256 x i8], [512 x i8], i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, double, double, double, double, i32, [6 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], [1 x %struct.__jmp_buf_tag], [40 x i8], ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, double, double, double, double, i32, i32, i32, i32, i32, i32, ptr, i32, i32, [1 x %struct.__jmp_buf_tag], [40 x i8], i32, double, ptr, ptr, ptr, %struct.qhmemT, %struct.qhstatT }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.qhmemT = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.qhstatT = type { [249 x %union.intrealT], [259 x i8], [249 x ptr], [249 x i16], [249 x i8], [249 x i8], [9 x %union.intrealT], i32, i32, i32, i32, double }
%union.intrealT = type { double }
%struct.setT = type { i32, [1 x %union.setelemT] }
%union.setelemT = type { ptr }
%struct.vertexT = type { ptr, ptr, ptr, ptr, i32, i32, i8 }

@.str.183 = external hidden unnamed_addr constant [71 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

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

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

declare i32 @qh_setsize(ptr noundef, ptr noundef) #1

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

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

declare ptr @qh_settemp(ptr noundef, i32 noundef) #1

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

declare ptr @qh_settemppop(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @qh_mergevertices(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call i32 @qh_setsize(ptr noundef %12, ptr noundef %13)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = call i32 @qh_setsize(ptr noundef %15, ptr noundef %17)
  %19 = add nsw i32 %14, %18
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.qhT, ptr %20, i32 0, i32 110
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = sub nsw i32 %19, %22
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %7, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.setT, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds [1 x %union.setelemT], ptr %27, i64 0, i64 0
  store ptr %28, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %7, align 4, !tbaa !16
  %31 = call ptr @qh_settemp(ptr noundef %29, i32 noundef %30)
  store ptr %31, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %104

34:                                               ; preds = %3
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.setT, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds [1 x %union.setelemT], ptr %36, i64 0, i64 0
  store ptr %37, ptr %10, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %102, %34
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds ptr, ptr %39, i32 1
  store ptr %40, ptr %10, align 8, !tbaa !5
  %41 = load ptr, ptr %39, align 8, !tbaa !5
  store ptr %41, ptr %9, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %103

43:                                               ; preds = %38
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %56

47:                                               ; preds = %43
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.vertexT, ptr %48, i32 0, i32 4
  %50 = load i32, ptr %49, align 8, !tbaa !17
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.vertexT, ptr %52, i32 0, i32 4
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = icmp ugt i32 %50, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %47, %43
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %57, ptr noundef %8, ptr noundef %58)
  br label %102

59:                                               ; preds = %47
  br label %60

60:                                               ; preds = %75, %59
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %73

64:                                               ; preds = %60
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.vertexT, ptr %66, i32 0, i32 4
  %68 = load i32, ptr %67, align 8, !tbaa !17
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.vertexT, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 8, !tbaa !17
  %72 = icmp ugt i32 %68, %71
  br label %73

73:                                               ; preds = %64, %60
  %74 = phi i1 [ false, %60 ], [ %72, %64 ]
  br i1 %74, label %75, label %80

75:                                               ; preds = %73
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i32 1
  store ptr %78, ptr %11, align 8, !tbaa !5
  %79 = load ptr, ptr %77, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %76, ptr noundef %8, ptr noundef %79)
  br label %60, !llvm.loop !19

80:                                               ; preds = %73
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %93

84:                                               ; preds = %80
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.vertexT, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !17
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.vertexT, ptr %89, i32 0, i32 4
  %91 = load i32, ptr %90, align 8, !tbaa !17
  %92 = icmp ult i32 %88, %91
  br i1 %92, label %93, label %96

93:                                               ; preds = %84, %80
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %94, ptr noundef %8, ptr noundef %95)
  br label %101

96:                                               ; preds = %84
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds ptr, ptr %98, i32 1
  store ptr %99, ptr %11, align 8, !tbaa !5
  %100 = load ptr, ptr %98, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %97, ptr noundef %8, ptr noundef %100)
  br label %101

101:                                              ; preds = %96, %93
  br label %102

102:                                              ; preds = %101, %56
  br label %38, !llvm.loop !21

103:                                              ; preds = %38
  br label %104

104:                                              ; preds = %103, %3
  br label %105

105:                                              ; preds = %109, %104
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %114

109:                                              ; preds = %105
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i32 1
  store ptr %112, ptr %11, align 8, !tbaa !5
  %113 = load ptr, ptr %111, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %110, ptr noundef %8, ptr noundef %113)
  br label %105, !llvm.loop !22

114:                                              ; preds = %105
  %115 = load i32, ptr %7, align 4, !tbaa !16
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = call i32 @qh_setsize(ptr noundef %116, ptr noundef %117)
  %119 = icmp slt i32 %115, %118
  br i1 %119, label %120, label %126

120:                                              ; preds = %114
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.qhT, ptr %122, i32 0, i32 158
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %121, ptr noundef %124, i32 noundef 6100, ptr noundef @.str.183)
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qh_errexit(ptr noundef %125, i32 noundef 5, ptr noundef null, ptr noundef null)
  br label %126

126:                                              ; preds = %120, %114
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %127, ptr noundef %128)
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %129, ptr %130, align 8, !tbaa !5
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = call ptr @qh_settemppop(ptr noundef %131)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

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


; 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"

@.str.183 = external hidden unnamed_addr constant [71 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

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

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

declare i32 @qh_setsize(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare ptr @qh_settemp(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare ptr @qh_settemppop(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @qh_mergevertices(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = tail call i32 @qh_setsize(ptr noundef %0, ptr noundef %1) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = tail call i32 @qh_setsize(ptr noundef %0, ptr noundef %6) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 632
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %10 = add i32 %5, 1
  %11 = add i32 %10, %7
  %12 = sub i32 %11, %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = tail call ptr @qh_settemp(ptr noundef %0, i32 noundef %12) #3
  store ptr %15, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %.loopexit, label %.preheader51

.preheader51:                                     ; preds = %3
  %.03957 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load ptr, ptr %.03957, align 8, !tbaa !5
  %.not4658 = icmp eq ptr %16, null
  br i1 %.not4658, label %.loopexit, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader51, %.critedge.thread
  %17 = phi ptr [ %34, %.critedge.thread ], [ %16, %.preheader51 ]
  %.03960 = phi ptr [ %.039, %.critedge.thread ], [ %.03957, %.preheader51 ]
  %.059 = phi ptr [ %.2, %.critedge.thread ], [ %14, %.preheader51 ]
  %18 = load ptr, ptr %.059, align 8, !tbaa !5
  %.not48 = icmp eq ptr %18, null
  br i1 %.not48, label %.critedge.thread, label %19

19:                                               ; preds = %.lr.ph61
  %20 = getelementptr inbounds i8, ptr %17, i64 32
  %21 = load i32, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %18, i64 32
  %23 = load i32, ptr %22, align 8, !tbaa !16
  %24 = icmp ugt i32 %21, %23
  br i1 %24, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %19, %30
  %25 = phi ptr [ %32, %30 ], [ %18, %19 ]
  %.156 = phi ptr [ %31, %30 ], [ %.059, %19 ]
  %26 = getelementptr inbounds i8, ptr %25, i64 32
  %27 = load i32, ptr %26, align 8, !tbaa !16
  %28 = load i32, ptr %20, align 8, !tbaa !16
  %29 = icmp ugt i32 %27, %28
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %.lr.ph
  %31 = getelementptr inbounds i8, ptr %.156, i64 8
  call void @qh_setappend(ptr noundef %0, ptr noundef nonnull %4, ptr noundef nonnull %25) #3
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %.not49 = icmp eq ptr %32, null
  br i1 %.not49, label %.critedge.thread, label %.lr.ph, !llvm.loop !18

.critedge:                                        ; preds = %.lr.ph
  %33 = icmp ult i32 %27, %28
  %spec.select = select i1 %33, ptr %17, ptr %25
  %spec.select76.idx = select i1 %33, i64 0, i64 8
  %spec.select76 = getelementptr inbounds i8, ptr %.156, i64 %spec.select76.idx
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %30, %.critedge, %.lr.ph61, %19
  %.sink = phi ptr [ %17, %19 ], [ %17, %.lr.ph61 ], [ %spec.select, %.critedge ], [ %17, %30 ]
  %.2 = phi ptr [ %.059, %19 ], [ %.059, %.lr.ph61 ], [ %spec.select76, %.critedge ], [ %31, %30 ]
  call void @qh_setappend(ptr noundef %0, ptr noundef nonnull %4, ptr noundef nonnull %.sink) #3
  %.039 = getelementptr inbounds i8, ptr %.03960, i64 8
  %34 = load ptr, ptr %.039, align 8, !tbaa !5
  %.not46 = icmp eq ptr %34, null
  br i1 %.not46, label %.loopexit, label %.lr.ph61, !llvm.loop !20

.loopexit:                                        ; preds = %.critedge.thread, %.preheader51, %3
  %.3 = phi ptr [ %14, %3 ], [ %14, %.preheader51 ], [ %.2, %.critedge.thread ]
  %35 = load ptr, ptr %.3, align 8, !tbaa !5
  %.not4763 = icmp eq ptr %35, null
  br i1 %.not4763, label %._crit_edge, label %.lr.ph65

.lr.ph65:                                         ; preds = %.loopexit, %.lr.ph65
  %36 = phi ptr [ %38, %.lr.ph65 ], [ %35, %.loopexit ]
  %.464 = phi ptr [ %37, %.lr.ph65 ], [ %.3, %.loopexit ]
  %37 = getelementptr inbounds i8, ptr %.464, i64 8
  call void @qh_setappend(ptr noundef %0, ptr noundef nonnull %4, ptr noundef nonnull %36) #3
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %.not47 = icmp eq ptr %38, null
  br i1 %.not47, label %._crit_edge, label %.lr.ph65, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph65, %.loopexit
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %39) #3
  %41 = icmp slt i32 %12, %40
  br i1 %41, label %42, label %45

42:                                               ; preds = %._crit_edge
  %43 = getelementptr inbounds i8, ptr %0, i64 2424
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %44, i32 noundef 6100, ptr noundef nonnull @.str.183) #3
  call void @qh_errexit(ptr noundef %0, i32 noundef 5, ptr noundef null, ptr noundef null) #3
  br label %45

45:                                               ; preds = %42, %._crit_edge
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %2) #3
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %46, ptr %2, align 8, !tbaa !5
  %47 = call ptr @qh_settemppop(ptr noundef %0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass