; 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.ridgeT = type { ptr, ptr, ptr, i32, i8 }
%struct.vertexT = type { ptr, ptr, ptr, ptr, i32, i32, i8 }
%struct.setT = type { i32, [1 x %union.setelemT] }
%union.setelemT = type { ptr }

@qh_qh = external global %struct.qhT, align 8
@qh_qhstat = external global %struct.qhstatT, align 8
@.str.209 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [63 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, 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 void @qh_errexit(i32 noundef, ptr noundef, ptr noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @qh_renameridgevertex(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.ridgeT, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call i32 @qh_setindex(ptr noundef %16, ptr noundef %17)
  store i32 %18, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %21, label %33

21:                                               ; preds = %3
  %22 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 158), align 8, !tbaa !13
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.vertexT, ptr %23, i32 0, i32 4
  %25 = load i32, ptr %24, align 8, !tbaa !17
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ridgeT, ptr %26, i32 0, i32 3
  %28 = load i32, ptr %27, align 8, !tbaa !19
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.vertexT, ptr %29, i32 0, i32 4
  %31 = load i32, ptr %30, align 8, !tbaa !17
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %22, i32 noundef 6424, ptr noundef @.str.209, i32 noundef %25, i32 noundef %28, i32 noundef %31)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_errexit(i32 noundef 5, ptr noundef null, ptr noundef %32)
  br label %33

33:                                               ; preds = %21, %3
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ridgeT, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = call ptr @qh_setdelnthsorted(ptr noundef %36, i32 noundef %37)
  store ptr null, ptr %11, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ridgeT, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %99

43:                                               ; preds = %33
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ridgeT, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.setT, ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds [1 x %union.setelemT], ptr %47, i64 0, i64 0
  store ptr %48, ptr %12, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %95, %43
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds ptr, ptr %50, i32 1
  store ptr %51, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %50, align 8, !tbaa !5
  store ptr %52, ptr %11, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %98

54:                                               ; preds = %49
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp eq ptr %55, %56
  br i1 %57, label %58, label %86

58:                                               ; preds = %54
  %59 = load i32, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 52), align 8, !tbaa !20
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr getelementptr inbounds ([249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 52), align 8, !tbaa !20
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ridgeT, ptr %61, i32 0, i32 4
  %63 = load i8, ptr %62, align 4
  %64 = lshr i8 %63, 2
  %65 = and i8 %64, 1
  %66 = zext i8 %65 to i32
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %58
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_copynonconvex(ptr noundef %69)
  br label %70

70:                                               ; preds = %68, %58
  %71 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 29), align 8, !tbaa !21
  %72 = icmp sge i32 %71, 2
  br i1 %72, label %73, label %84

73:                                               ; preds = %70
  %74 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 158), align 8, !tbaa !13
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ridgeT, ptr %75, i32 0, i32 3
  %77 = load i32, ptr %76, align 8, !tbaa !19
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.vertexT, ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 8, !tbaa !17
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.vertexT, ptr %81, i32 0, i32 4
  %83 = load i32, ptr %82, align 8, !tbaa !17
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %74, i32 noundef 2038, ptr noundef @.str.210, i32 noundef %77, i32 noundef %80, i32 noundef %83)
  br label %84

84:                                               ; preds = %73, %70
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_delridge_merge(ptr noundef %85)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %141

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

94:                                               ; preds = %86
  br label %98

95:                                               ; preds = %86
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %8, align 4, !tbaa !9
  br label %49, !llvm.loop !22

98:                                               ; preds = %94, %49
  br label %99

99:                                               ; preds = %98, %33
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ridgeT, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  call void @qh_setaddnth(ptr noundef %101, i32 noundef %102, ptr noundef %103)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ridgeT, ptr %104, i32 0, i32 4
  %106 = load i8, ptr %105, align 4
  %107 = and i8 %106, -33
  %108 = or i8 %107, 0
  store i8 %108, ptr %105, align 4
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ridgeT, ptr %109, i32 0, i32 4
  %111 = load i8, ptr %110, align 4
  %112 = and i8 %111, -65
  %113 = or i8 %112, 0
  store i8 %113, ptr %110, align 4
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = load i32, ptr %8, align 4, !tbaa !9
  %116 = sub nsw i32 %114, %115
  %117 = call i32 @llvm.abs.i32(i32 %116, i1 true)
  %118 = srem i32 %117, 2
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %140

120:                                              ; preds = %99
  %121 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 29), align 8, !tbaa !21
  %122 = icmp sge i32 %121, 3
  br i1 %122, label %123, label %128

123:                                              ; preds = %120
  %124 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 158), align 8, !tbaa !13
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ridgeT, ptr %125, i32 0, i32 3
  %127 = load i32, ptr %126, align 8, !tbaa !19
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %124, i32 noundef 3010, ptr noundef @.str.211, i32 noundef %127)
  br label %128

128:                                              ; preds = %123, %120
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ridgeT, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !24
  store ptr %131, ptr %10, align 8, !tbaa !5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ridgeT, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !25
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ridgeT, ptr %135, i32 0, i32 1
  store ptr %134, ptr %136, align 8, !tbaa !24
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ridgeT, ptr %138, i32 0, i32 2
  store ptr %137, ptr %139, align 8, !tbaa !25
  br label %140

140:                                              ; preds = %128, %99
  store i32 1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %141

141:                                              ; preds = %140, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %142 = load i32, ptr %4, align 4
  ret i32 %142
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

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


; 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
@qh_qhstat = external local_unnamed_addr global %struct.qhstatT, align 8
@.str.209 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [63 x i8], align 1

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

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

declare void @qh_setaddnth(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

declare i32 @qh_setindex(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @qh_renameridgevertex(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = tail call i32 @qh_setindex(ptr noundef %4, ptr noundef %1) #2
  %6 = icmp slt i32 %5, 0
  br i1 %6, label %7, label %15

7:                                                ; preds = %3
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2424), align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %1, i64 32
  %10 = load i32, ptr %9, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %2, i64 32
  %14 = load i32, ptr %13, align 8, !tbaa !15
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %8, i32 noundef 6424, ptr noundef nonnull @.str.209, i32 noundef %10, i32 noundef %12, i32 noundef %14) #2
  tail call void @qh_errexit(i32 noundef 5, ptr noundef null, ptr noundef nonnull %0) #2
  br label %15

15:                                               ; preds = %7, %3
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = tail call ptr @qh_setdelnthsorted(ptr noundef %16, i32 noundef %5) #2
  %18 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %15
  %.046 = getelementptr inbounds i8, ptr %18, i64 8
  %19 = load ptr, ptr %.046, align 8, !tbaa !18
  %.not4247 = icmp eq ptr %19, null
  br i1 %.not4247, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %20 = getelementptr inbounds i8, ptr %2, i64 32
  br label %21

21:                                               ; preds = %.lr.ph, %47
  %22 = phi ptr [ %19, %.lr.ph ], [ %49, %47 ]
  %.049 = phi ptr [ %.046, %.lr.ph ], [ %.0, %47 ]
  %.03748 = phi i32 [ 0, %.lr.ph ], [ %48, %47 ]
  %23 = icmp eq ptr %22, %2
  br i1 %23, label %24, label %42

24:                                               ; preds = %21
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 416), align 8, !tbaa !19
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 416), align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %0, i64 28
  %28 = load i8, ptr %27, align 4
  %29 = and i8 %28, 4
  %.not44 = icmp eq i8 %29, 0
  br i1 %.not44, label %31, label %30

30:                                               ; preds = %24
  tail call void @qh_copynonconvex(ptr noundef nonnull %0)
  br label %31

31:                                               ; preds = %30, %24
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 136), align 8, !tbaa !20
  %33 = icmp sgt i32 %32, 1
  br i1 %33, label %34, label %41

34:                                               ; preds = %31
  %35 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2424), align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  %37 = load i32, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds i8, ptr %1, i64 32
  %39 = load i32, ptr %38, align 8, !tbaa !15
  %40 = load i32, ptr %20, align 8, !tbaa !15
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %35, i32 noundef 2038, ptr noundef nonnull @.str.210, i32 noundef %37, i32 noundef %39, i32 noundef %40) #2
  br label %41

41:                                               ; preds = %34, %31
  tail call void @qh_delridge_merge(ptr noundef nonnull %0)
  br label %66

42:                                               ; preds = %21
  %43 = getelementptr inbounds i8, ptr %22, i64 32
  %44 = load i32, ptr %43, align 8, !tbaa !15
  %45 = load i32, ptr %20, align 8, !tbaa !15
  %46 = icmp ult i32 %44, %45
  br i1 %46, label %.loopexit, label %47

47:                                               ; preds = %42
  %48 = add nuw nsw i32 %.03748, 1
  %.0 = getelementptr inbounds i8, ptr %.049, i64 8
  %49 = load ptr, ptr %.0, align 8, !tbaa !18
  %.not42 = icmp eq ptr %49, null
  br i1 %.not42, label %.loopexit, label %21, !llvm.loop !21

.loopexit:                                        ; preds = %42, %47, %.preheader, %15
  %.1 = phi i32 [ 0, %15 ], [ 0, %.preheader ], [ %.03748, %42 ], [ %48, %47 ]
  tail call void @qh_setaddnth(ptr noundef nonnull %0, i32 noundef %.1, ptr noundef %2) #2
  %50 = getelementptr inbounds i8, ptr %0, i64 28
  %51 = load i8, ptr %50, align 4
  %52 = and i8 %51, -97
  store i8 %52, ptr %50, align 4
  %53 = sub nsw i32 %5, %.1
  %54 = and i32 %53, 1
  %.not43 = icmp eq i32 %54, 0
  br i1 %.not43, label %66, label %55

55:                                               ; preds = %.loopexit
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 136), align 8, !tbaa !20
  %57 = icmp sgt i32 %56, 2
  br i1 %57, label %58, label %62

58:                                               ; preds = %55
  %59 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2424), align 8, !tbaa !11
  %60 = getelementptr inbounds i8, ptr %0, i64 24
  %61 = load i32, ptr %60, align 8, !tbaa !17
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %59, i32 noundef 3010, ptr noundef nonnull @.str.211, i32 noundef %61) #2
  br label %62

62:                                               ; preds = %58, %55
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  %64 = load <2 x ptr>, ptr %63, align 8, !tbaa !18
  %65 = shufflevector <2 x ptr> %64, <2 x ptr> poison, <2 x i32> <i32 1, i32 0>
  store <2 x ptr> %65, ptr %63, align 8, !tbaa !18
  br label %66

66:                                               ; preds = %.loopexit, %62, %41
  %.036 = phi i32 [ 0, %41 ], [ 1, %62 ], [ 1, %.loopexit ]
  ret i32 %.036
}

declare ptr @qh_setdelnthsorted(ptr noundef, i32 noundef) local_unnamed_addr #0

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass