; LLVM IR from jrl-umi3218/mc_rtc :: 3rd-party/qhull/src/libqhull_r (io_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"

@.str.73 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [21 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, 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 i32 @qh_pointid(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printline3geom(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca [4 x double], align 16
  %13 = alloca [4 x double], align 16
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 0
  call void @qh_projectdim3(ptr noundef %14, ptr noundef %15, ptr noundef %16)
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds [4 x double], ptr %13, i64 0, i64 0
  call void @qh_projectdim3(ptr noundef %17, ptr noundef %18, ptr noundef %19)
  %20 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 0
  %21 = load double, ptr %20, align 16, !tbaa !9
  %22 = getelementptr inbounds [4 x double], ptr %13, i64 0, i64 0
  %23 = load double, ptr %22, align 16, !tbaa !9
  %24 = fsub double %21, %23
  %25 = call double @llvm.fabs.f64(double %24)
  %26 = fcmp ogt double %25, 1.000000e-03
  br i1 %26, label %43, label %27

27:                                               ; preds = %5
  %28 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 1
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds [4 x double], ptr %13, i64 0, i64 1
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = fsub double %29, %31
  %33 = call double @llvm.fabs.f64(double %32)
  %34 = fcmp ogt double %33, 1.000000e-03
  br i1 %34, label %43, label %35

35:                                               ; preds = %27
  %36 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 2
  %37 = load double, ptr %36, align 16, !tbaa !9
  %38 = getelementptr inbounds [4 x double], ptr %13, i64 0, i64 2
  %39 = load double, ptr %38, align 16, !tbaa !9
  %40 = fsub double %37, %39
  %41 = call double @llvm.fabs.f64(double %40)
  %42 = fcmp ogt double %41, 1.000000e-03
  br i1 %42, label %43, label %65

43:                                               ; preds = %35, %27, %5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %44, ptr noundef %45, i32 noundef 9204, ptr noundef @.str.164)
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %56, %43
  %47 = load i32, ptr %11, align 4, !tbaa !11
  %48 = icmp slt i32 %47, 3
  br i1 %48, label %49, label %59

49:                                               ; preds = %46
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load i32, ptr %11, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [4 x double], ptr %13, i64 0, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %50, ptr noundef %51, i32 noundef 9205, ptr noundef @.str.73, double noundef %55)
  br label %56

56:                                               ; preds = %49
  %57 = load i32, ptr %11, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %11, align 4, !tbaa !11
  br label %46, !llvm.loop !13

59:                                               ; preds = %46
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = call i32 @qh_pointid(ptr noundef %62, ptr noundef %63)
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %60, ptr noundef %61, i32 noundef 9206, ptr noundef @.str.165, i32 noundef %64)
  br label %68

65:                                               ; preds = %35
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %66, ptr noundef %67, i32 noundef 9207, ptr noundef @.str.166)
  br label %68

68:                                               ; preds = %65, %59
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %79, %68
  %70 = load i32, ptr %11, align 4, !tbaa !11
  %71 = icmp slt i32 %70, 3
  br i1 %71, label %72, label %82

72:                                               ; preds = %69
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %73, ptr noundef %74, i32 noundef 9208, ptr noundef @.str.73, double noundef %78)
  br label %79

79:                                               ; preds = %72
  %80 = load i32, ptr %11, align 4, !tbaa !11
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !11
  br label %69, !llvm.loop !15

82:                                               ; preds = %69
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = call i32 @qh_pointid(ptr noundef %85, ptr noundef %86)
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %83, ptr noundef %84, i32 noundef 9209, ptr noundef @.str.165, i32 noundef %87)
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = getelementptr inbounds double, ptr %90, i64 0
  %92 = load double, ptr %91, align 8, !tbaa !9
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds double, ptr %93, i64 1
  %95 = load double, ptr %94, align 8, !tbaa !9
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds double, ptr %96, i64 2
  %98 = load double, ptr %97, align 8, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %88, ptr noundef %89, i32 noundef 9210, ptr noundef @.str.167, double noundef %92, double noundef %95, double noundef %98)
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.73 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [21 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

declare void @qh_fprintf(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) 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 i32 @qh_pointid(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printline3geom(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #2 {
  %6 = alloca [4 x double], align 16
  %7 = alloca [4 x double], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @qh_projectdim3(ptr noundef %0, ptr noundef %2, ptr noundef nonnull %6)
  call void @qh_projectdim3(ptr noundef %0, ptr noundef %3, ptr noundef nonnull %7)
  %8 = load double, ptr %6, align 16, !tbaa !5
  %9 = load double, ptr %7, align 16, !tbaa !5
  %10 = fsub double %8, %9
  %11 = call double @llvm.fabs.f64(double %10)
  %12 = fcmp ogt double %11, 1.000000e-03
  br i1 %12, label %29, label %13

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = fsub double %15, %17
  %19 = call double @llvm.fabs.f64(double %18)
  %20 = fcmp ogt double %19, 1.000000e-03
  br i1 %20, label %29, label %21

21:                                               ; preds = %13
  %22 = getelementptr inbounds i8, ptr %6, i64 16
  %23 = load double, ptr %22, align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %7, i64 16
  %25 = load double, ptr %24, align 16, !tbaa !5
  %26 = fsub double %23, %25
  %27 = call double @llvm.fabs.f64(double %26)
  %28 = fcmp ogt double %27, 1.000000e-03
  br i1 %28, label %29, label %36

29:                                               ; preds = %21, %13, %5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9204, ptr noundef nonnull @.str.164) #4
  %30 = load double, ptr %7, align 16, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9205, ptr noundef nonnull @.str.73, double noundef %30) #4
  %31 = getelementptr inbounds i8, ptr %7, i64 8
  %32 = load double, ptr %31, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9205, ptr noundef nonnull @.str.73, double noundef %32) #4
  %33 = getelementptr inbounds i8, ptr %7, i64 16
  %34 = load double, ptr %33, align 16, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9205, ptr noundef nonnull @.str.73, double noundef %34) #4
  %35 = call i32 @qh_pointid(ptr noundef %0, ptr noundef %3) #4
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9206, ptr noundef nonnull @.str.165, i32 noundef %35) #4
  br label %37

36:                                               ; preds = %21
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9207, ptr noundef nonnull @.str.166) #4
  br label %37

37:                                               ; preds = %36, %29
  %38 = load double, ptr %6, align 16, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9208, ptr noundef nonnull @.str.73, double noundef %38) #4
  %39 = getelementptr inbounds i8, ptr %6, i64 8
  %40 = load double, ptr %39, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9208, ptr noundef nonnull @.str.73, double noundef %40) #4
  %41 = getelementptr inbounds i8, ptr %6, i64 16
  %42 = load double, ptr %41, align 16, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9208, ptr noundef nonnull @.str.73, double noundef %42) #4
  %43 = call i32 @qh_pointid(ptr noundef %0, ptr noundef %2) #4
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9209, ptr noundef nonnull @.str.165, i32 noundef %43) #4
  %44 = load double, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %4, i64 8
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %4, i64 16
  %48 = load double, ptr %47, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9210, ptr noundef nonnull @.str.167, double noundef %44, double noundef %46, double noundef %48) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

attributes #0 = { mustprogress 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 = { mustprogress 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass