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

%struct.ridgeT = type { ptr, ptr, ptr, i32, i8 }
%struct.facetT = type { double, double, double, ptr, %union.anon, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }
%union.anon = type { double }

@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.176 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.177 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printridge(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  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
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %6, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.ridgeT, ptr %9, i32 0, i32 3
  %11 = load i32, ptr %10, align 8, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %7, ptr noundef %8, i32 noundef 9222, ptr noundef @.str.170, i32 noundef %11)
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ridgeT, ptr %12, i32 0, i32 4
  %14 = load i8, ptr %13, align 4
  %15 = lshr i8 %14, 1
  %16 = and i8 %15, 1
  %17 = zext i8 %16 to i32
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %22

19:                                               ; preds = %3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %20, ptr noundef %21, i32 noundef 9223, ptr noundef @.str.101)
  br label %22

22:                                               ; preds = %19, %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ridgeT, ptr %23, i32 0, i32 4
  %25 = load i8, ptr %24, align 4
  %26 = lshr i8 %25, 2
  %27 = and i8 %26, 1
  %28 = zext i8 %27 to i32
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %22
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %31, ptr noundef %32, i32 noundef 9224, ptr noundef @.str.171)
  br label %33

33:                                               ; preds = %30, %22
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ridgeT, ptr %34, i32 0, i32 4
  %36 = load i8, ptr %35, align 4
  %37 = lshr i8 %36, 3
  %38 = and i8 %37, 1
  %39 = zext i8 %38 to i32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %33
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %42, ptr noundef %43, i32 noundef 9421, ptr noundef @.str.172)
  br label %44

44:                                               ; preds = %41, %33
  %45 = load ptr, ptr %6, 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, 4
  %49 = and i8 %48, 1
  %50 = zext i8 %49 to i32
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %44
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %53, ptr noundef %54, i32 noundef 9422, ptr noundef @.str.173)
  br label %55

55:                                               ; preds = %52, %44
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ridgeT, ptr %56, i32 0, i32 4
  %58 = load i8, ptr %57, align 4
  %59 = lshr i8 %58, 5
  %60 = and i8 %59, 1
  %61 = zext i8 %60 to i32
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %55
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %64, ptr noundef %65, i32 noundef 9425, ptr noundef @.str.174)
  br label %66

66:                                               ; preds = %63, %55
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ridgeT, ptr %67, i32 0, i32 4
  %69 = load i8, ptr %68, align 4
  %70 = lshr i8 %69, 6
  %71 = and i8 %70, 1
  %72 = zext i8 %71 to i32
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %77

74:                                               ; preds = %66
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %75, ptr noundef %76, i32 noundef 9423, ptr noundef @.str.175)
  br label %77

77:                                               ; preds = %74, %66
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %78, ptr noundef %79, i32 noundef 9225, ptr noundef @.str.18)
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ridgeT, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !12
  call void @qh_printvertices(ptr noundef %80, ptr noundef %81, ptr noundef @.str.176, ptr noundef %84)
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ridgeT, ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !13
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %107

89:                                               ; preds = %77
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ridgeT, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %107

94:                                               ; preds = %89
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ridgeT, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  %100 = getelementptr inbounds %struct.facetT, ptr %99, i32 0, i32 14
  %101 = load i32, ptr %100, align 4, !tbaa !15
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ridgeT, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !14
  %105 = getelementptr inbounds %struct.facetT, ptr %104, i32 0, i32 14
  %106 = load i32, ptr %105, align 4, !tbaa !15
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %95, ptr noundef %96, i32 noundef 9226, ptr noundef @.str.177, i32 noundef %101, i32 noundef %106)
  br label %107

107:                                              ; preds = %94, %89, %77
  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" }

!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, !11, i64 24}
!10 = !{!"ridgeT", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !11, i64 28, !11, i64 28, !11, i64 28, !11, i64 28, !11, i64 28, !11, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !6, i64 16}
!15 = !{!16, !11, i64 108}
!16 = !{!"facetT", !17, i64 0, !17, i64 8, !17, i64 16, !6, i64 24, !7, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 113, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 114, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115, !11, i64 115}
!17 = !{!"double", !7, i64 0}


; 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.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.176 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.177 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @qh_printridge(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %2, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9222, ptr noundef nonnull @.str.170, i32 noundef %5) #2
  %6 = getelementptr inbounds i8, ptr %2, i64 28
  %7 = load i8, ptr %6, align 4
  %8 = and i8 %7, 2
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %10, label %9

9:                                                ; preds = %3
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9223, ptr noundef nonnull @.str.101) #2
  %.pre = load i8, ptr %6, align 4
  br label %10

10:                                               ; preds = %9, %3
  %11 = phi i8 [ %.pre, %9 ], [ %7, %3 ]
  %12 = and i8 %11, 4
  %.not33 = icmp eq i8 %12, 0
  br i1 %.not33, label %14, label %13

13:                                               ; preds = %10
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9224, ptr noundef nonnull @.str.171) #2
  %.pre40 = load i8, ptr %6, align 4
  br label %14

14:                                               ; preds = %13, %10
  %15 = phi i8 [ %.pre40, %13 ], [ %11, %10 ]
  %16 = and i8 %15, 8
  %.not34 = icmp eq i8 %16, 0
  br i1 %.not34, label %18, label %17

17:                                               ; preds = %14
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9421, ptr noundef nonnull @.str.172) #2
  %.pre41 = load i8, ptr %6, align 4
  br label %18

18:                                               ; preds = %17, %14
  %19 = phi i8 [ %.pre41, %17 ], [ %15, %14 ]
  %20 = and i8 %19, 16
  %.not35 = icmp eq i8 %20, 0
  br i1 %.not35, label %22, label %21

21:                                               ; preds = %18
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9422, ptr noundef nonnull @.str.173) #2
  %.pre42 = load i8, ptr %6, align 4
  br label %22

22:                                               ; preds = %21, %18
  %23 = phi i8 [ %.pre42, %21 ], [ %19, %18 ]
  %24 = and i8 %23, 32
  %.not36 = icmp eq i8 %24, 0
  br i1 %.not36, label %26, label %25

25:                                               ; preds = %22
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9425, ptr noundef nonnull @.str.174) #2
  %.pre43 = load i8, ptr %6, align 4
  br label %26

26:                                               ; preds = %25, %22
  %27 = phi i8 [ %.pre43, %25 ], [ %23, %22 ]
  %28 = and i8 %27, 64
  %.not37 = icmp eq i8 %28, 0
  br i1 %.not37, label %30, label %29

29:                                               ; preds = %26
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9423, ptr noundef nonnull @.str.175) #2
  br label %30

30:                                               ; preds = %29, %26
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9225, ptr noundef nonnull @.str.18) #2
  %31 = load ptr, ptr %2, align 8, !tbaa !11
  tail call void @qh_printvertices(ptr noundef %0, ptr noundef %1, ptr noundef nonnull @.str.176, ptr noundef %31)
  %32 = getelementptr inbounds i8, ptr %2, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !12
  %.not38 = icmp eq ptr %33, null
  br i1 %.not38, label %42, label %34

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %2, i64 16
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %.not39 = icmp eq ptr %36, null
  br i1 %.not39, label %42, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %33, i64 108
  %39 = load i32, ptr %38, align 4, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %36, i64 108
  %41 = load i32, ptr %40, align 4, !tbaa !14
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %1, i32 noundef 9226, ptr noundef nonnull @.str.177, i32 noundef %39, i32 noundef %41) #2
  br label %42

42:                                               ; preds = %37, %34, %30
  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, !10, i64 24}
!6 = !{!"ridgeT", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 28, !10, i64 28, !10, i64 28, !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 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, i64 16}
!14 = !{!15, !10, i64 108}
!15 = !{!"facetT", !16, i64 0, !16, i64 8, !16, i64 16, !7, i64 24, !8, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 113, !10, i64 113, !10, i64 113, !10, i64 113, !10, i64 113, !10, i64 113, !10, i64 113, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 114, !10, i64 115, !10, i64 115, !10, i64 115, !10, i64 115, !10, i64 115, !10, i64 115, !10, i64 115, !10, i64 115}
!16 = !{!"double", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass