; LLVM IR from Discngine/fpocket :: src/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"

%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.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

16:                                               ; preds = %2
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %17, i32 noundef 9223, ptr noundef @.str.100)
  br label %18

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

26:                                               ; preds = %18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %27, i32 noundef 9224, ptr noundef @.str.165)
  br label %28

28:                                               ; preds = %26, %18
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %29, i32 noundef 9225, ptr noundef @.str.17)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ridgeT, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !12
  call void @qh_printvertices(ptr noundef %30, ptr noundef @.str.166, ptr noundef %33)
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ridgeT, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %55

38:                                               ; preds = %28
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ridgeT, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %55

43:                                               ; preds = %38
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ridgeT, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  %48 = getelementptr inbounds %struct.facetT, ptr %47, i32 0, i32 14
  %49 = load i32, ptr %48, align 4, !tbaa !15
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ridgeT, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds %struct.facetT, ptr %52, i32 0, i32 14
  %54 = load i32, ptr %53, align 4, !tbaa !15
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %44, i32 noundef 9226, ptr noundef @.str.167, i32 noundef %49, i32 noundef %54)
  br label %55

55:                                               ; preds = %43, %38, %28
  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 = !{!"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.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [32 x i8], align 1

declare void @qh_fprintf(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) local_unnamed_addr #1

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

8:                                                ; preds = %2
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9223, ptr noundef nonnull @.str.100) #2
  %.pre = load i8, ptr %5, align 4
  br label %9

9:                                                ; preds = %8, %2
  %10 = phi i8 [ %.pre, %8 ], [ %6, %2 ]
  %11 = and i8 %10, 4
  %.not15 = icmp eq i8 %11, 0
  br i1 %.not15, label %13, label %12

12:                                               ; preds = %9
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9224, ptr noundef nonnull @.str.165) #2
  br label %13

13:                                               ; preds = %12, %9
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9225, ptr noundef nonnull @.str.17) #2
  %14 = load ptr, ptr %1, align 8, !tbaa !11
  tail call void @qh_printvertices(ptr noundef %0, ptr noundef nonnull @.str.166, ptr noundef %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  %.not16 = icmp eq ptr %16, null
  br i1 %.not16, label %25, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %.not17 = icmp eq ptr %19, null
  br i1 %.not17, label %25, label %20

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %16, i64 108
  %22 = load i32, ptr %21, align 4, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %19, i64 108
  %24 = load i32, ptr %23, align 4, !tbaa !14
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, i32 noundef 9226, ptr noundef nonnull @.str.167, i32 noundef %22, i32 noundef %24) #2
  br label %25

25:                                               ; preds = %20, %17, %13
  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}
!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