; LLVM IR from Discngine/fpocket :: src/qhull/src/libqhullcpp (QhullFacetSet)

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

%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator" = type { ptr, ptr }
%"class.orgQhull::QhullFacet" = type { ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet11isSelectAllEv(ptr noundef nonnull align 8 dereferenceable(17)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull10QhullFacet6isGoodEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet8containsERKNS_10QhullFacetE(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator", align 8
  %7 = alloca %"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.orgQhull::QhullFacet", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  %13 = call noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet11isSelectAllEv(ptr noundef nonnull align 8 dereferenceable(17) %12)
  br i1 %13, label %14, label %17

14:                                               ; preds = %2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE8containsERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %15)
  store i1 %16, ptr %3, align 1
  br label %42

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE5beginEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %12)
  br label %18

18:                                               ; preds = %37, %17
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE3endEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %19 = call noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  store i32 2, ptr %8, align 4
  br label %39

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratordeEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullFacet") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = invoke noundef zeroext i1 @_ZNK8orgQhull10QhullFaceteqERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %24 unwind label %29

24:                                               ; preds = %21
  br i1 %23, label %25, label %33

25:                                               ; preds = %24
  %26 = invoke noundef zeroext i1 @_ZNK8orgQhull10QhullFacet6isGoodEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %27 unwind label %29

27:                                               ; preds = %25
  br i1 %26, label %28, label %33

28:                                               ; preds = %27
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %34

29:                                               ; preds = %25, %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %10, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %11, align 4
  call void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  br label %44

33:                                               ; preds = %27, %24
  store i32 0, ptr %8, align 4
  br label %34

34:                                               ; preds = %33, %28
  call void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  %35 = load i32, ptr %8, align 4
  switch i32 %35, label %39 [
    i32 0, label %36
  ]

36:                                               ; preds = %34
  br label %37

37:                                               ; preds = %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  br label %18, !llvm.loop !9

39:                                               ; preds = %34, %20
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  %40 = load i32, ptr %8, align 4
  switch i32 %40, label %49 [
    i32 2, label %41
    i32 1, label %42
  ]

41:                                               ; preds = %39
  store i1 false, ptr %3, align 1
  br label %42

42:                                               ; preds = %41, %39, %14
  %43 = load i1, ptr %3, align 1
  ret i1 %43

44:                                               ; preds = %29
  %45 = load ptr, ptr %10, align 8
  %46 = load i32, ptr %11, align 4
  %47 = insertvalue { ptr, i32 } poison, ptr %45, 0
  %48 = insertvalue { ptr, i32 } %47, i32 %46, 1
  resume { ptr, i32 } %48

49:                                               ; preds = %39
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE8containsERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE3endEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratordeEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullFacet") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull10QhullFaceteqERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"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"

%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator" = type { ptr, ptr }
%"class.orgQhull::QhullFacet" = type { ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet11isSelectAllEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull10QhullFacet6isGoodEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet8containsERKNS_10QhullFacetE(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator", align 8
  %4 = alloca %"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator", align 8
  %5 = alloca %"class.orgQhull::QhullFacet", align 8
  %6 = tail call noundef zeroext i1 @_ZNK8orgQhull13QhullFacetSet11isSelectAllEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  br i1 %6, label %7, label %9

7:                                                ; preds = %2
  %8 = tail call noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE8containsERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %18

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %0)
  %10 = call noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %10, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %9, %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratordeEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullFacet") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %11 = call noundef zeroext i1 @_ZNK8orgQhull10QhullFaceteqERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br i1 %11, label %12, label %.critedge

12:                                               ; preds = %.lr.ph
  %13 = call noundef zeroext i1 @_ZNK8orgQhull10QhullFacet6isGoodEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  br i1 %13, label %16, label %.critedge

.critedge:                                        ; preds = %12, %.lr.ph
  call void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %0)
  %15 = call noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %15, label %.lr.ph, label %.loopexit, !llvm.loop !5

16:                                               ; preds = %12
  call void @_ZN8orgQhull10QhullFacetD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge, %9, %16
  %17 = phi i1 [ true, %16 ], [ false, %9 ], [ false, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  br label %18

18:                                               ; preds = %.loopexit, %7
  %.3 = phi i1 [ %8, %7 ], [ %17, %.loopexit ]
  ret i1 %.3
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE8containsERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE3endEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullSet<orgQhull::QhullFacet>::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratordeEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullFacet") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8orgQhull10QhullFaceteqERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN8orgQhull8QhullSetINS_10QhullFacetEE14const_iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass