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

@qh_qh = external global %struct.qhT, align 8
@qh_qhstat = external global %struct.qhstatT, align 8
@.str.108 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.109 = 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_setaddnth(ptr noundef, i32 noundef, ptr noundef) #1

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

declare void @qh_delridge(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @qh_renameridgevertex(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 i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  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) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, 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
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ridgeT, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call i32 @qh_setindex(ptr noundef %15, ptr noundef %16)
  store i32 %17, ptr %8, align 4, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ridgeT, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = call ptr @qh_setdelnthsorted(ptr noundef %20, i32 noundef %21)
  store ptr null, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ridgeT, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %83

27:                                               ; preds = %3
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ridgeT, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.setT, ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds [1 x %union.setelemT], ptr %31, i64 0, i64 0
  store ptr %32, ptr %11, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %79, %27
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = getelementptr inbounds ptr, ptr %34, i32 1
  store ptr %35, ptr %11, align 8, !tbaa !5
  %36 = load ptr, ptr %34, align 8, !tbaa !5
  store ptr %36, ptr %10, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %82

38:                                               ; preds = %33
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = icmp eq ptr %39, %40
  br i1 %41, label %42, label %70

42:                                               ; preds = %38
  %43 = load i32, ptr getelementptr inbounds ([227 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 48), align 8, !tbaa !13
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr getelementptr inbounds ([227 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 48), align 8, !tbaa !13
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ridgeT, ptr %45, i32 0, i32 4
  %47 = load i8, ptr %46, align 4
  %48 = lshr i8 %47, 2
  %49 = and i8 %48, 1
  %50 = zext i8 %49 to i32
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %42
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qh_copynonconvex(ptr noundef %53)
  br label %54

54:                                               ; preds = %52, %42
  %55 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 24), align 8, !tbaa !14
  %56 = icmp sge i32 %55, 2
  br i1 %56, label %57, label %68

57:                                               ; preds = %54
  %58 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 151), align 8, !tbaa !18
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ridgeT, ptr %59, i32 0, i32 3
  %61 = load i32, ptr %60, align 8, !tbaa !19
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.vertexT, ptr %62, i32 0, i32 4
  %64 = load i32, ptr %63, align 8, !tbaa !20
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.vertexT, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 8, !tbaa !20
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %58, i32 noundef 2038, ptr noundef @.str.108, i32 noundef %61, i32 noundef %64, i32 noundef %67)
  br label %68

68:                                               ; preds = %57, %54
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qh_delridge(ptr noundef %69)
  store i32 1, ptr %12, align 4
  br label %115

70:                                               ; preds = %38
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.vertexT, ptr %71, i32 0, i32 4
  %73 = load i32, ptr %72, align 8, !tbaa !20
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.vertexT, ptr %74, i32 0, i32 4
  %76 = load i32, ptr %75, align 8, !tbaa !20
  %77 = icmp ult i32 %73, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %70
  br label %82

79:                                               ; preds = %70
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %7, align 4, !tbaa !9
  br label %33, !llvm.loop !22

82:                                               ; preds = %78, %33
  br label %83

83:                                               ; preds = %82, %3
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ridgeT, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_setaddnth(ptr noundef %85, i32 noundef %86, ptr noundef %87)
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = sub nsw i32 %88, %89
  %91 = call i32 @llvm.abs.i32(i32 %90, i1 true)
  %92 = srem i32 %91, 2
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %114

94:                                               ; preds = %83
  %95 = load i32, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 24), align 8, !tbaa !14
  %96 = icmp sge i32 %95, 3
  br i1 %96, label %97, label %102

97:                                               ; preds = %94
  %98 = load ptr, ptr getelementptr inbounds (%struct.qhT, ptr @qh_qh, i32 0, i32 151), align 8, !tbaa !18
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ridgeT, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 8, !tbaa !19
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %98, i32 noundef 3010, ptr noundef @.str.109, i32 noundef %101)
  br label %102

102:                                              ; preds = %97, %94
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ridgeT, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !24
  store ptr %105, ptr %9, align 8, !tbaa !5
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ridgeT, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !25
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ridgeT, ptr %109, i32 0, i32 1
  store ptr %108, ptr %110, align 8, !tbaa !24
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ridgeT, ptr %112, i32 0, i32 2
  store ptr %111, ptr %113, align 8, !tbaa !25
  br label %114

114:                                              ; preds = %102, %83
  store i32 0, ptr %12, align 4
  br label %115

115:                                              ; preds = %114, %68
  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 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %116 = load i32, ptr %12, align 4
  switch i32 %116, label %118 [
    i32 0, label %117
    i32 1, label %117
  ]

117:                                              ; preds = %115, %115
  ret void

118:                                              ; preds = %115
  unreachable
}

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

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}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 128}
!15 = !{!"qhT", !10, i64 0, !10, i64 4, !10, i64 8, !16, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !16, i64 56, !16, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !6, i64 96, !10, i64 104, !10, i64 108, !6, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !16, i64 152, !16, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !16, i64 184, !16, i64 192, !10, i64 200, !16, i64 208, !10, i64 216, !10, i64 220, !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, !7, i64 296, !10, i64 412, !10, i64 416, !10, i64 420, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !16, i64 448, !16, i64 456, !16, 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, !16, i64 544, !10, i64 552, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !16, i64 584, !10, i64 592, !6, i64 600, !6, i64 608, !10, i64 616, !10, i64 620, !10, i64 624, !10, i64 628, !10, i64 632, !6, i64 640, !10, i64 648, !6, i64 656, !10, i64 664, !7, i64 668, !10, i64 924, !7, i64 928, !7, i64 1184, !10, i64 1696, !10, i64 1700, !10, i64 1704, !10, i64 1708, !10, i64 1712, !10, i64 1716, !6, i64 1720, !6, i64 1728, !6, i64 1736, !6, i64 1744, !16, i64 1752, !16, i64 1760, !16, i64 1768, !16, i64 1776, !16, i64 1784, !16, i64 1792, !16, i64 1800, !16, i64 1808, !16, i64 1816, !16, i64 1824, !16, i64 1832, !16, i64 1840, !16, i64 1848, !10, i64 1856, !6, i64 1864, !16, i64 1872, !16, i64 1880, !16, i64 1888, !16, 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, !10, i64 2424, !10, i64 2428, !10, i64 2432, !6, i64 2440, !6, i64 2448, !6, i64 2456, !6, i64 2464, !6, i64 2472, !10, i64 2480, !10, i64 2484, !6, i64 2488, !10, i64 2496, !6, i64 2504, !6, i64 2512, !6, i64 2520, !6, i64 2528, !10, i64 2536, !10, i64 2540, !10, i64 2544, !10, i64 2548, !10, i64 2552, !10, i64 2556, !10, i64 2560, !17, i64 2568, !10, i64 2576, !10, i64 2580, !10, i64 2584, !10, i64 2588, !6, i64 2592, !10, i64 2600, !10, i64 2604, !16, i64 2608, !10, i64 2616, !16, i64 2624, !16, i64 2632, !16, i64 2640, !10, i64 2648, !10, i64 2652, !10, i64 2656, !10, i64 2660, !16, i64 2664, !16, i64 2672, !10, i64 2680, !10, i64 2684, !10, i64 2688, !10, i64 2692, !16, i64 2696, !16, i64 2704, !10, i64 2712, !10, i64 2716, !10, i64 2720, !10, 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, !10, i64 2792, !6, i64 2800, !6, i64 2808, !10, i64 2816, !10, i64 2820, !10, i64 2824, !6, i64 2832, !16, i64 2840, !16, i64 2848, !16, i64 2856, !10, i64 2864, !10, i64 2868, !6, i64 2872, !6, i64 2880, !10, i64 2888}
!16 = !{!"double", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!15, !6, i64 2408}
!19 = !{!12, !10, i64 24}
!20 = !{!21, !10, i64 32}
!21 = !{!"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}
!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, 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 local_unnamed_addr global %struct.qhT, align 8
@qh_qhstat = external local_unnamed_addr global %struct.qhstatT, align 8
@.str.108 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.109 = 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_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

declare void @qh_delridge(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @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 = load ptr, ptr %0, align 8, !tbaa !5
  %7 = tail call ptr @qh_setdelnthsorted(ptr noundef %6, i32 noundef %5) #2
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %3
  %.037 = getelementptr inbounds i8, ptr %8, i64 8
  %9 = load ptr, ptr %.037, align 8, !tbaa !11
  %.not3338 = icmp eq ptr %9, null
  br i1 %.not3338, label %.loopexit, label %.lr.ph

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

11:                                               ; preds = %.lr.ph, %37
  %12 = phi ptr [ %9, %.lr.ph ], [ %39, %37 ]
  %.040 = phi ptr [ %.037, %.lr.ph ], [ %.0, %37 ]
  %.02839 = phi i32 [ 0, %.lr.ph ], [ %38, %37 ]
  %13 = icmp eq ptr %12, %2
  br i1 %13, label %14, label %32

14:                                               ; preds = %11
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 384), align 8, !tbaa !12
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 384), align 8, !tbaa !12
  %17 = getelementptr inbounds i8, ptr %0, i64 28
  %18 = load i8, ptr %17, align 4
  %19 = and i8 %18, 4
  %.not35 = icmp eq i8 %19, 0
  br i1 %.not35, label %21, label %20

20:                                               ; preds = %14
  tail call void @qh_copynonconvex(ptr noundef nonnull %0)
  br label %21

21:                                               ; preds = %20, %14
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 128), align 8, !tbaa !13
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %24, label %31

24:                                               ; preds = %21
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2408), align 8, !tbaa !17
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = load i32, ptr %26, align 8, !tbaa !18
  %28 = getelementptr inbounds i8, ptr %1, i64 32
  %29 = load i32, ptr %28, align 8, !tbaa !19
  %30 = load i32, ptr %10, align 8, !tbaa !19
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %25, i32 noundef 2038, ptr noundef nonnull @.str.108, i32 noundef %27, i32 noundef %29, i32 noundef %30) #2
  br label %31

31:                                               ; preds = %24, %21
  tail call void @qh_delridge(ptr noundef nonnull %0) #2
  br label %53

32:                                               ; preds = %11
  %33 = getelementptr inbounds i8, ptr %12, i64 32
  %34 = load i32, ptr %33, align 8, !tbaa !19
  %35 = load i32, ptr %10, align 8, !tbaa !19
  %36 = icmp ult i32 %34, %35
  br i1 %36, label %.loopexit, label %37

37:                                               ; preds = %32
  %38 = add nuw nsw i32 %.02839, 1
  %.0 = getelementptr inbounds i8, ptr %.040, i64 8
  %39 = load ptr, ptr %.0, align 8, !tbaa !11
  %.not33 = icmp eq ptr %39, null
  br i1 %.not33, label %.loopexit, label %11, !llvm.loop !21

.loopexit:                                        ; preds = %32, %37, %.preheader, %3
  %.1 = phi i32 [ 0, %3 ], [ 0, %.preheader ], [ %.02839, %32 ], [ %38, %37 ]
  tail call void @qh_setaddnth(ptr noundef nonnull %0, i32 noundef %.1, ptr noundef %2) #2
  %40 = sub nsw i32 %5, %.1
  %41 = and i32 %40, 1
  %.not34 = icmp eq i32 %41, 0
  br i1 %.not34, label %53, label %42

42:                                               ; preds = %.loopexit
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 128), align 8, !tbaa !13
  %44 = icmp sgt i32 %43, 2
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = load ptr, ptr getelementptr inbounds (i8, ptr @qh_qh, i64 2408), align 8, !tbaa !17
  %47 = getelementptr inbounds i8, ptr %0, i64 24
  %48 = load i32, ptr %47, align 8, !tbaa !18
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %46, i32 noundef 3010, ptr noundef nonnull @.str.109, i32 noundef %48) #2
  br label %49

49:                                               ; preds = %45, %42
  %50 = getelementptr inbounds i8, ptr %0, i64 8
  %51 = load <2 x ptr>, ptr %50, align 8, !tbaa !11
  %52 = shufflevector <2 x ptr> %51, <2 x ptr> poison, <2 x i32> <i32 1, i32 0>
  store <2 x ptr> %52, ptr %50, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %.loopexit, %49, %31
  ret void
}

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

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