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

; 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.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_qhstat = external dso_local global %struct.qhstatT, align 8
@.str.222 = external hidden unnamed_addr constant [123 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatA() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatB() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatC() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatD() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatE() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatE2() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatF() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatG() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatH() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatI() #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatistics() #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_initstatistics() #0 {
  %1 = alloca i32, align 4
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @qh_allstatistics()
  store i32 0, ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 7), align 8, !tbaa !5
  call void @qh_allstatA()
  call void @qh_allstatB()
  call void @qh_allstatC()
  call void @qh_allstatD()
  call void @qh_allstatE()
  call void @qh_allstatE2()
  call void @qh_allstatF()
  call void @qh_allstatG()
  call void @qh_allstatH()
  call void @qh_allstatI()
  %4 = load i32, ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 7), align 8, !tbaa !5
  %5 = icmp sgt i32 %4, 259
  br i1 %5, label %6, label %8

6:                                                ; preds = %0
  %7 = load i32, ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 7), align 8, !tbaa !5
  call void (i32, ptr, ...) @qh_fprintf_stderr(i32 noundef 6184, ptr noundef @.str.222, i32 noundef %7, i32 noundef 259)
  call void @qh_exit(i32 noundef 5)
  br label %8

8:                                                ; preds = %6, %0
  store i32 0, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 1), align 8, !tbaa !11
  store i32 0, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 2), align 8, !tbaa !11
  store i32 2147483647, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 4), align 8, !tbaa !11
  store i32 -2147483648, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 3), align 8, !tbaa !11
  store double 0.000000e+00, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 6), align 8, !tbaa !11
  store double 0x7FEFFFFFFFFFFFFF, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 8), align 8, !tbaa !11
  store double 0xFFEFFFFFFFFFFFFF, ptr getelementptr inbounds ([9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 7), align 8, !tbaa !11
  store i32 0, ptr %1, align 4, !tbaa !12
  br label %9

9:                                                ; preds = %52, %8
  %10 = load i32, ptr %1, align 4, !tbaa !12
  %11 = icmp slt i32 %10, 249
  br i1 %11, label %12, label %55

12:                                               ; preds = %9
  %13 = load i32, ptr %1, align 4, !tbaa !12
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [249 x i8], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 4), i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = sext i8 %16 to i32
  %18 = icmp sgt i32 %17, 5
  br i1 %18, label %19, label %31

19:                                               ; preds = %12
  %20 = load i32, ptr %1, align 4, !tbaa !12
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [249 x i8], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 4), i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = zext i8 %23 to i64
  %25 = getelementptr inbounds [9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 %24
  %26 = load double, ptr %25, align 8, !tbaa !11
  store double %26, ptr %2, align 8, !tbaa !13
  %27 = load double, ptr %2, align 8, !tbaa !13
  %28 = load i32, ptr %1, align 4, !tbaa !12
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 %29
  store double %27, ptr %30, align 8, !tbaa !11
  br label %51

31:                                               ; preds = %12
  %32 = load i32, ptr %1, align 4, !tbaa !12
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [249 x i8], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 4), i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %50

38:                                               ; preds = %31
  %39 = load i32, ptr %1, align 4, !tbaa !12
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [249 x i8], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 4), i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = zext i8 %42 to i64
  %44 = getelementptr inbounds [9 x %union.intrealT], ptr getelementptr inbounds (%struct.qhstatT, ptr @qh_qhstat, i32 0, i32 6), i64 0, i64 %43
  %45 = load i32, ptr %44, align 8, !tbaa !11
  store i32 %45, ptr %3, align 4, !tbaa !12
  %46 = load i32, ptr %3, align 4, !tbaa !12
  %47 = load i32, ptr %1, align 4, !tbaa !12
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 %48
  store i32 %46, ptr %49, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %38, %31
  br label %51

51:                                               ; preds = %50, %19
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %1, align 4, !tbaa !12
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %1, align 4, !tbaa !12
  br label %9, !llvm.loop !14

55:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

declare void @qh_fprintf_stderr(i32 noundef, ptr noundef, ...) #2

declare void @qh_exit(i32 noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !9, i64 5320}
!6 = !{!"qhstatT", !7, i64 0, !7, i64 1992, !7, i64 2256, !7, i64 4248, !7, i64 4746, !7, i64 4995, !7, i64 5248, !9, i64 5320, !9, i64 5324, !9, i64 5328, !9, i64 5332, !10, i64 5336}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!9, !9, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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.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_qhstat = external dso_local local_unnamed_addr global %struct.qhstatT, align 8
@.str.222 = external hidden unnamed_addr constant [123 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatA() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatB() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatC() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatD() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatE() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatE2() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatF() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatG() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatH() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatI() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @qh_allstatistics() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @qh_initstatistics() local_unnamed_addr #0 {
  tail call void @qh_allstatistics()
  store i32 0, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5320), align 8, !tbaa !5
  tail call void @qh_allstatA()
  tail call void @qh_allstatB()
  tail call void @qh_allstatC()
  tail call void @qh_allstatD()
  tail call void @qh_allstatE()
  tail call void @qh_allstatE2()
  tail call void @qh_allstatF()
  tail call void @qh_allstatG()
  tail call void @qh_allstatH()
  tail call void @qh_allstatI()
  %1 = load i32, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5320), align 8, !tbaa !5
  %2 = icmp sgt i32 %1, 259
  br i1 %2, label %3, label %4

3:                                                ; preds = %0
  tail call void (i32, ptr, ...) @qh_fprintf_stderr(i32 noundef 6184, ptr noundef nonnull @.str.222, i32 noundef %1, i32 noundef 259) #2
  tail call void @qh_exit(i32 noundef 5) #2
  br label %4

4:                                                ; preds = %3, %0
  store i32 0, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5256), align 8, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5264), align 8, !tbaa !11
  store i32 2147483647, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5280), align 8, !tbaa !11
  store i32 -2147483648, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5272), align 8, !tbaa !11
  store double 0x7FEFFFFFFFFFFFFF, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5312), align 8, !tbaa !11
  store <2 x double> <double 0.000000e+00, double 0xFFEFFFFFFFFFFFFF>, ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5296), align 8, !tbaa !11
  br label %5

5:                                                ; preds = %4, %20
  %indvars.iv = phi i64 [ 0, %4 ], [ %indvars.iv.next, %20 ]
  %6 = getelementptr inbounds [249 x i8], ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 4746), i64 0, i64 %indvars.iv
  %7 = load i8, ptr %6, align 1, !tbaa !11
  %8 = icmp sgt i8 %7, 5
  br i1 %8, label %9, label %14

9:                                                ; preds = %5
  %10 = zext nneg i8 %7 to i64
  %11 = getelementptr inbounds [9 x %union.intrealT], ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5248), i64 0, i64 %10
  %12 = load double, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds [249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 %indvars.iv
  store double %12, ptr %13, align 8, !tbaa !11
  br label %20

14:                                               ; preds = %5
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %20, label %15

15:                                               ; preds = %14
  %16 = zext i8 %7 to i64
  %17 = getelementptr inbounds [9 x %union.intrealT], ptr getelementptr inbounds (i8, ptr @qh_qhstat, i64 5248), i64 0, i64 %16
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds [249 x %union.intrealT], ptr @qh_qhstat, i64 0, i64 %indvars.iv
  store i32 %18, ptr %19, align 8, !tbaa !11
  br label %20

20:                                               ; preds = %9, %15, %14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 249
  br i1 %exitcond.not, label %21, label %5, !llvm.loop !12

21:                                               ; preds = %20
  ret void
}

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

declare void @qh_exit(i32 noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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, !9, i64 5320}
!6 = !{!"qhstatT", !7, i64 0, !7, i64 1992, !7, i64 2256, !7, i64 4248, !7, i64 4746, !7, i64 4995, !7, i64 5248, !9, i64 5320, !9, i64 5324, !9, i64 5328, !9, i64 5332, !10, i64 5336}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass