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

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

@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [7 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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printpointid(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = 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 ptr %3, ptr %9, align 8, !tbaa !5
  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 8, ptr %12) #3
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %5
  store i32 1, ptr %13, align 4
  br label %53

17:                                               ; preds = %5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %32

20:                                               ; preds = %17
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %21, i32 noundef 9211, ptr noundef @.str.83, ptr noundef %22)
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp ne i32 %23, -1
  br i1 %24, label %25, label %31

25:                                               ; preds = %20
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = icmp ne i32 %26, -3
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i32, ptr %10, align 4, !tbaa !9
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %29, i32 noundef 9212, ptr noundef @.str.168, i32 noundef %30)
  br label %31

31:                                               ; preds = %28, %25, %20
  br label %32

32:                                               ; preds = %31, %17
  %33 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %33, ptr %11, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %50, %32
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr %11, align 4, !tbaa !9
  %37 = icmp ne i32 %35, 0
  br i1 %37, label %38, label %51

38:                                               ; preds = %34
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i32 1
  store ptr %40, ptr %9, align 8, !tbaa !5
  %41 = load double, ptr %39, align 8, !tbaa !11
  store double %41, ptr %12, align 8, !tbaa !11
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %47

44:                                               ; preds = %38
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load double, ptr %12, align 8, !tbaa !11
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %45, i32 noundef 9213, ptr noundef @.str.169, double noundef %46)
  br label %50

47:                                               ; preds = %38
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load double, ptr %12, align 8, !tbaa !11
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %48, i32 noundef 9214, ptr noundef @.str.17, double noundef %49)
  br label %50

50:                                               ; preds = %47, %44
  br label %34, !llvm.loop !13

51:                                               ; preds = %34
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %52, i32 noundef 9215, ptr noundef @.str.18)
  store i32 0, ptr %13, align 4
  br label %53

53:                                               ; preds = %51, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %54 = load i32, ptr %13, align 4
  switch i32 %54, label %56 [
    i32 0, label %55
    i32 1, label %55
  ]

55:                                               ; preds = %53, %53
  ret void

56:                                               ; preds = %53
  unreachable
}

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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printpointid(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef readonly %3, i32 noundef %4) local_unnamed_addr #1 {
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %21, label %6

6:                                                ; preds = %5
  %.not21 = icmp eq ptr %1, null
  br i1 %.not21, label %.thread, label %7

7:                                                ; preds = %6
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9211, ptr noundef nonnull @.str.83, ptr noundef nonnull %1) #2
  %8 = and i32 %4, -3
  %or.cond.not = icmp eq i32 %8, -3
  br i1 %or.cond.not, label %10, label %9

9:                                                ; preds = %7
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9212, ptr noundef nonnull @.str.168, i32 noundef %4) #2
  br label %10

10:                                               ; preds = %7, %9
  %.not2223 = icmp eq i32 %2, 0
  br i1 %.not2223, label %._crit_edge, label %.lr.ph

.thread:                                          ; preds = %6
  %.not222326 = icmp eq i32 %2, 0
  br i1 %.not222326, label %._crit_edge, label %.lr.ph.thread

.lr.ph.thread:                                    ; preds = %.thread
  %11 = add nsw i32 %2, -1
  br label %.lr.ph.split.us.preheader

.lr.ph:                                           ; preds = %10
  %12 = add nsw i32 %2, -1
  br i1 %.not21, label %.lr.ph.split.us.preheader, label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph.thread, %.lr.ph
  %.ph = phi i32 [ %12, %.lr.ph ], [ %11, %.lr.ph.thread ]
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %.lr.ph.split.us
  %13 = phi i32 [ %16, %.lr.ph.split.us ], [ %.ph, %.lr.ph.split.us.preheader ]
  %.024.us = phi ptr [ %14, %.lr.ph.split.us ], [ %3, %.lr.ph.split.us.preheader ]
  %14 = getelementptr inbounds i8, ptr %.024.us, i64 8
  %15 = load double, ptr %.024.us, align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9214, ptr noundef nonnull @.str.17, double noundef %15) #2
  %16 = add nsw i32 %13, -1
  %.not22.us = icmp eq i32 %13, 0
  br i1 %.not22.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !9

.lr.ph.split:                                     ; preds = %.lr.ph, %.lr.ph.split
  %17 = phi i32 [ %20, %.lr.ph.split ], [ %12, %.lr.ph ]
  %.024 = phi ptr [ %18, %.lr.ph.split ], [ %3, %.lr.ph ]
  %18 = getelementptr inbounds i8, ptr %.024, i64 8
  %19 = load double, ptr %.024, align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9213, ptr noundef nonnull @.str.169, double noundef %19) #2
  %20 = add nsw i32 %17, -1
  %.not22 = icmp eq i32 %17, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph.split, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph.split, %.lr.ph.split.us, %.thread, %10
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9215, ptr noundef nonnull @.str.18) #2
  br label %21

21:                                               ; preds = %5, %._crit_edge
  ret void
}

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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass