; LLVM IR from jrl-umi3218/mc_rtc :: 3rd-party/qhull/src/user_eg2 (user_eg2_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 }

@.str.6 = external hidden unnamed_addr constant [110 x i8], align 1
@stdout = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [65 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 i32 @printf(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_fprintf(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

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

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

declare void @qh_check_maxout(ptr noundef) #1

declare void @qh_nearcoplanar(ptr noundef) #1

declare i32 @qh_rand(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @addDelaunay(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.qhT, ptr %18, i32 0, i32 197
  %20 = load double, ptr %19, align 8, !tbaa !11
  %21 = fcmp olt double %20, 0x7FDFFFFFFFFFFFFF
  br i1 %21, label %22, label %32

22:                                               ; preds = %5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.qhT, ptr %23, i32 0, i32 52
  %25 = load i32, ptr %24, align 4, !tbaa !17
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %32, label %27

27:                                               ; preds = %22
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.qhT, ptr %29, i32 0, i32 158
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %28, ptr noundef %31, i32 noundef 7097, ptr noundef @.str.6)
  br label %32

32:                                               ; preds = %27, %22, %5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %115, %32
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %118

37:                                               ; preds = %33
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = add nsw i32 %39, %40
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = mul nsw i32 %41, %42
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %38, i64 %44
  store ptr %45, ptr %13, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.qhT, ptr %47, i32 0, i32 113
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = icmp eq ptr %46, %49
  br i1 %50, label %51, label %58

51:                                               ; preds = %37
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = add nsw i32 %52, %53
  %55 = add nsw i32 %54, 1
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.qhT, ptr %56, i32 0, i32 112
  store i32 %55, ptr %57, align 8, !tbaa !20
  br label %58

58:                                               ; preds = %51, %37
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %76, %58
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = sub nsw i32 %61, 1
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %64, label %79

64:                                               ; preds = %59
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call i32 @qh_rand(ptr noundef %65)
  %67 = sitofp i32 %66 to double
  store double %67, ptr %14, align 8, !tbaa !21
  %68 = load double, ptr %14, align 8, !tbaa !21
  %69 = fmul double 2.000000e+00, %68
  %70 = fdiv double %69, 0x41DFFFFFFFC00000
  %71 = fsub double %70, 1.000000e+00
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %72, i64 %74
  store double %71, ptr %75, align 8, !tbaa !21
  br label %76

76:                                               ; preds = %64
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %12, align 4, !tbaa !9
  br label %59, !llvm.loop !22

79:                                               ; preds = %59
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  call void @qh_setdelaunay(ptr noundef %80, i32 noundef %81, i32 noundef 1, ptr noundef %82)
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = call ptr @qh_findbestfacet(ptr noundef %83, ptr noundef %84, i32 noundef 0, ptr noundef %16, ptr noundef %17)
  store ptr %85, ptr %15, align 8, !tbaa !5
  %86 = load i32, ptr %17, align 4, !tbaa !9
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %96

88:                                               ; preds = %79
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = call i32 @qh_addpoint(ptr noundef %89, ptr noundef %90, ptr noundef %91, i32 noundef 0)
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  br label %118

95:                                               ; preds = %88
  br label %96

96:                                               ; preds = %95, %79
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load ptr, ptr @stdout, align 8, !tbaa !5
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  call void @qh_printpoint(ptr noundef %97, ptr noundef %98, ptr noundef @.str.7, ptr noundef %99)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.qhT, ptr %100, i32 0, i32 112
  %102 = load i32, ptr %101, align 8, !tbaa !20
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.qhT, ptr %104, i32 0, i32 225
  %106 = load ptr, ptr %105, align 8, !tbaa !24
  %107 = call i32 @qh_setsize(ptr noundef %103, ptr noundef %106)
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.qhT, ptr %108, i32 0, i32 179
  %110 = load i32, ptr %109, align 4, !tbaa !25
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.qhT, ptr %111, i32 0, i32 178
  %113 = load i32, ptr %112, align 8, !tbaa !26
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %102, i32 noundef %107, i32 noundef %110, i32 noundef %113)
  br label %115

115:                                              ; preds = %96
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %11, align 4, !tbaa !9
  br label %33, !llvm.loop !27

118:                                              ; preds = %94, %33
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.qhT, ptr %119, i32 0, i32 105
  %121 = load i32, ptr %120, align 8, !tbaa !28
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %125

123:                                              ; preds = %118
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_check_maxout(ptr noundef %124)
  br label %133

125:                                              ; preds = %118
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.qhT, ptr %126, i32 0, i32 109
  %128 = load i32, ptr %127, align 4, !tbaa !29
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %125
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_nearcoplanar(ptr noundef %131)
  br label %132

132:                                              ; preds = %130, %125
  br label %133

133:                                              ; preds = %132, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

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

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

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 2664}
!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, !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, !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, !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, !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, !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, !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, !6, i64 1872, !13, i64 1880, !13, i64 1888, !13, i64 1896, !13, 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, !14, 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, !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, !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, !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, !6, i64 2976, !10, i64 2984, !10, i64 2988, !7, i64 2992, !7, i64 3192, !10, i64 3232, !13, i64 3240, !6, i64 3248, !6, i64 3256, !6, i64 3264, !15, i64 3272, !16, i64 3424}
!13 = !{!"double", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"qhmemT", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144}
!16 = !{!"qhstatT", !7, i64 0, !7, i64 1992, !7, i64 2256, !7, i64 4248, !7, i64 4746, !7, i64 4995, !7, i64 5248, !10, i64 5320, !10, i64 5324, !10, i64 5328, !10, i64 5332, !13, i64 5336}
!17 = !{!12, !10, i64 252}
!18 = !{!12, !6, i64 2424}
!19 = !{!12, !6, i64 648}
!20 = !{!12, !10, i64 640}
!21 = !{!13, !13, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !6, i64 2832}
!25 = !{!12, !10, i64 2572}
!26 = !{!12, !10, i64 2568}
!27 = distinct !{!27, !23}
!28 = !{!12, !10, i64 600}
!29 = !{!12, !10, i64 628}


; 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.6 = external hidden unnamed_addr constant [110 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [65 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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 void @qh_fprintf(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @qh_findbestfacet(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @qh_addpoint(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @qh_check_maxout(ptr noundef) local_unnamed_addr #2

declare void @qh_nearcoplanar(ptr noundef) local_unnamed_addr #2

declare i32 @qh_rand(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local void @addDelaunay(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 2664
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = fcmp olt double %9, 0x7FDFFFFFFFFFFFFF
  br i1 %10, label %11, label %17

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 252
  %13 = load i32, ptr %12, align 4, !tbaa !15
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %17

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 2424
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef nonnull %0, ptr noundef %16, i32 noundef 7097, ptr noundef nonnull @.str.6) #4
  br label %17

17:                                               ; preds = %14, %11, %5
  %18 = icmp sgt i32 %3, 0
  br i1 %18, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %17
  %19 = getelementptr inbounds i8, ptr %0, i64 648
  %20 = getelementptr inbounds i8, ptr %0, i64 640
  %21 = icmp sgt i32 %4, 1
  %22 = getelementptr inbounds i8, ptr %0, i64 2832
  %23 = getelementptr inbounds i8, ptr %0, i64 2572
  %24 = getelementptr inbounds i8, ptr %0, i64 2568
  %25 = sext i32 %2 to i64
  %wide.trip.count62 = zext nneg i32 %3 to i64
  br i1 %21, label %.lr.ph49.split.us.preheader, label %.lr.ph49.split.preheader

.lr.ph49.split.preheader:                         ; preds = %.lr.ph49
  %26 = sext i32 %4 to i64
  br label %.lr.ph49.split

.lr.ph49.split.us.preheader:                      ; preds = %.lr.ph49
  %27 = add nsw i32 %4, -1
  %28 = zext nneg i32 %4 to i64
  %wide.trip.count57 = zext i32 %27 to i64
  br label %.lr.ph49.split.us

.lr.ph49.split.us:                                ; preds = %.lr.ph49.split.us.preheader, %39
  %indvars.iv59 = phi i64 [ 0, %.lr.ph49.split.us.preheader ], [ %indvars.iv.next60, %39 ]
  %29 = add nsw i64 %indvars.iv59, %25
  %30 = mul nsw i64 %29, %28
  %31 = getelementptr inbounds double, ptr %1, i64 %30
  %32 = load ptr, ptr %19, align 8, !tbaa !17
  %33 = icmp eq ptr %32, %1
  br i1 %33, label %34, label %.lr.ph.us.preheader

.lr.ph.us.preheader:                              ; preds = %34, %.lr.ph49.split.us
  br label %.lr.ph.us

34:                                               ; preds = %.lr.ph49.split.us
  %35 = trunc i64 %29 to i32
  %36 = add i32 %35, 1
  store i32 %36, ptr %20, align 8, !tbaa !18
  br label %.lr.ph.us.preheader

37:                                               ; preds = %._crit_edge.us
  %38 = call i32 @qh_addpoint(ptr noundef %0, ptr noundef nonnull %31, ptr noundef %53, i32 noundef 0) #4
  %.not43.us = icmp eq i32 %38, 0
  br i1 %.not43.us, label %._crit_edge50, label %39

39:                                               ; preds = %37, %._crit_edge.us
  %40 = load ptr, ptr @stdout, align 8, !tbaa !19
  call void @qh_printpoint(ptr noundef %0, ptr noundef %40, ptr noundef nonnull @.str.7, ptr noundef nonnull %31) #4
  %41 = load i32, ptr %20, align 8, !tbaa !18
  %42 = load ptr, ptr %22, align 8, !tbaa !20
  %43 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %42) #4
  %44 = load i32, ptr %23, align 4, !tbaa !21
  %45 = load i32, ptr %24, align 8, !tbaa !22
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %41, i32 noundef %43, i32 noundef %44, i32 noundef %45)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count62
  br i1 %exitcond63.not, label %._crit_edge50, label %.lr.ph49.split.us, !llvm.loop !23

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %.lr.ph.us
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph.us ], [ 0, %.lr.ph.us.preheader ]
  %47 = call i32 @qh_rand(ptr noundef %0) #4
  %48 = sitofp i32 %47 to double
  %49 = fmul double %48, 2.000000e+00
  %50 = fdiv double %49, 0x41DFFFFFFFC00000
  %51 = fadd double %50, -1.000000e+00
  %52 = getelementptr inbounds double, ptr %31, i64 %indvars.iv54
  store double %51, ptr %52, align 8, !tbaa !25
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57
  br i1 %exitcond58.not, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !26

._crit_edge.us:                                   ; preds = %.lr.ph.us
  call void @qh_setdelaunay(ptr noundef %0, i32 noundef %4, i32 noundef 1, ptr noundef nonnull %31) #4
  %53 = call ptr @qh_findbestfacet(ptr noundef %0, ptr noundef nonnull %31, i32 noundef 0, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %54 = load i32, ptr %7, align 4, !tbaa !27
  %.not42.us = icmp eq i32 %54, 0
  br i1 %.not42.us, label %39, label %37

.lr.ph49.split:                                   ; preds = %.lr.ph49.split.preheader, %68
  %indvars.iv = phi i64 [ 0, %.lr.ph49.split.preheader ], [ %indvars.iv.next, %68 ]
  %55 = add nsw i64 %indvars.iv, %25
  %56 = mul nsw i64 %55, %26
  %57 = getelementptr inbounds double, ptr %1, i64 %56
  %58 = load ptr, ptr %19, align 8, !tbaa !17
  %59 = icmp eq ptr %58, %1
  br i1 %59, label %60, label %63

60:                                               ; preds = %.lr.ph49.split
  %61 = trunc i64 %55 to i32
  %62 = add i32 %61, 1
  store i32 %62, ptr %20, align 8, !tbaa !18
  br label %63

63:                                               ; preds = %60, %.lr.ph49.split
  call void @qh_setdelaunay(ptr noundef nonnull %0, i32 noundef %4, i32 noundef 1, ptr noundef %57) #4
  %64 = call ptr @qh_findbestfacet(ptr noundef nonnull %0, ptr noundef %57, i32 noundef 0, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %65 = load i32, ptr %7, align 4, !tbaa !27
  %.not42 = icmp eq i32 %65, 0
  br i1 %.not42, label %68, label %66

66:                                               ; preds = %63
  %67 = call i32 @qh_addpoint(ptr noundef %0, ptr noundef %57, ptr noundef %64, i32 noundef 0) #4
  %.not43 = icmp eq i32 %67, 0
  br i1 %.not43, label %._crit_edge50, label %68

68:                                               ; preds = %66, %63
  %69 = load ptr, ptr @stdout, align 8, !tbaa !19
  call void @qh_printpoint(ptr noundef %0, ptr noundef %69, ptr noundef nonnull @.str.7, ptr noundef %57) #4
  %70 = load i32, ptr %20, align 8, !tbaa !18
  %71 = load ptr, ptr %22, align 8, !tbaa !20
  %72 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %71) #4
  %73 = load i32, ptr %23, align 4, !tbaa !21
  %74 = load i32, ptr %24, align 8, !tbaa !22
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %70, i32 noundef %72, i32 noundef %73, i32 noundef %74)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count62
  br i1 %exitcond.not, label %._crit_edge50, label %.lr.ph49.split, !llvm.loop !23

._crit_edge50:                                    ; preds = %68, %66, %39, %37, %17
  %76 = getelementptr inbounds i8, ptr %0, i64 600
  %77 = load i32, ptr %76, align 8, !tbaa !28
  %.not44 = icmp eq i32 %77, 0
  br i1 %.not44, label %79, label %78

78:                                               ; preds = %._crit_edge50
  call void @qh_check_maxout(ptr noundef nonnull %0) #4
  br label %83

79:                                               ; preds = %._crit_edge50
  %80 = getelementptr inbounds i8, ptr %0, i64 628
  %81 = load i32, ptr %80, align 4, !tbaa !29
  %.not45 = icmp eq i32 %81, 0
  br i1 %.not45, label %83, label %82

82:                                               ; preds = %79
  call void @qh_nearcoplanar(ptr noundef nonnull %0) #4
  br label %83

83:                                               ; preds = %79, %82, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret void
}

declare void @qh_printpoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass