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

; 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::QhullPoints::const_iterator" = type { %"class.orgQhull::QhullPoint.base", [4 x i8] }
%"class.orgQhull::QhullPoint.base" = type <{ ptr, ptr, i32 }>

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints5beginEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(28)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints3endEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(28)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8orgQhull11QhullPoints8containsERKNS_10QhullPointE(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(20) %1) #1 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::QhullPoints::const_iterator", align 8
  %7 = alloca %"class.orgQhull::QhullPoints::const_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.orgQhull::QhullPoints::const_iterator", align 8
  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
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #4
  call void @_ZNK8orgQhull11QhullPoints5beginEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(28) %12)
  br label %13

13:                                               ; preds = %38, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  invoke void @_ZNK8orgQhull11QhullPoints3endEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(28) %12)
          to label %14 unwind label %24

14:                                               ; preds = %13
  %15 = invoke noundef zeroext i1 @_ZNK8orgQhull11QhullPoints14const_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %6, ptr noundef nonnull align 8 dereferenceable(20) %7)
          to label %16 unwind label %28

16:                                               ; preds = %14
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  br i1 %15, label %17, label %39

17:                                               ; preds = %16
  %18 = invoke noundef nonnull align 8 dereferenceable(20) ptr @_ZNK8orgQhull11QhullPoints14const_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(20) %6)
          to label %19 unwind label %33

19:                                               ; preds = %17
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = invoke noundef zeroext i1 @_ZNK8orgQhull10QhullPointeqERKS0_(ptr noundef nonnull align 8 dereferenceable(20) %18, ptr noundef nonnull align 8 dereferenceable(20) %20)
          to label %22 unwind label %33

22:                                               ; preds = %19
  br i1 %21, label %23, label %37

23:                                               ; preds = %22
  store i1 true, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %40

24:                                               ; preds = %13
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %8, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %9, align 4
  br label %32

28:                                               ; preds = %14
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %8, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %9, align 4
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #4
  br label %32

32:                                               ; preds = %28, %24
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  br label %42

33:                                               ; preds = %37, %19, %17
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %8, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %9, align 4
  br label %42

37:                                               ; preds = %22
  invoke void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %11, ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef 0)
          to label %38 unwind label %33

38:                                               ; preds = %37
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %11) #4
  br label %13, !llvm.loop !9

39:                                               ; preds = %16
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %40

40:                                               ; preds = %39, %23
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #4
  %41 = load i1, ptr %3, align 1
  ret i1 %41

42:                                               ; preds = %33, %32
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #4
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %8, align 8
  %45 = load i32, ptr %9, align 4
  %46 = insertvalue { ptr, i32 } poison, ptr %44, 0
  %47 = insertvalue { ptr, i32 } %46, i32 %45, 1
  resume { ptr, i32 } %47
}

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

declare noundef zeroext i1 @_ZNK8orgQhull10QhullPointeqERKS0_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 #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++ 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::QhullPoints::const_iterator" = type { %"class.orgQhull::QhullPoint.base", [4 x i8] }
%"class.orgQhull::QhullPoint.base" = type <{ ptr, ptr, i32 }>

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints5beginEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints3endEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8orgQhull11QhullPoints8containsERKNS_10QhullPointE(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(20) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.orgQhull::QhullPoints::const_iterator", align 8
  %4 = alloca %"class.orgQhull::QhullPoints::const_iterator", align 8
  %5 = alloca %"class.orgQhull::QhullPoints::const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNK8orgQhull11QhullPoints5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(28) %0)
  br label %6

6:                                                ; preds = %22, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  invoke void @_ZNK8orgQhull11QhullPoints3endEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(28) %0)
          to label %7 unwind label %14

7:                                                ; preds = %6
  %8 = invoke noundef zeroext i1 @_ZNK8orgQhull11QhullPoints14const_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 8 dereferenceable(20) %4)
          to label %9 unwind label %16

9:                                                ; preds = %7
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br i1 %8, label %10, label %23

10:                                               ; preds = %9
  %11 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK8orgQhull11QhullPoints14const_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(20) %3)
  %12 = invoke noundef zeroext i1 @_ZNK8orgQhull10QhullPointeqERKS0_(ptr noundef nonnull align 8 dereferenceable(20) %11, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %13 unwind label %19

13:                                               ; preds = %10
  br i1 %12, label %23, label %21

14:                                               ; preds = %6
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %18

16:                                               ; preds = %7
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #4
  br label %18

18:                                               ; preds = %16, %14
  %.pn = phi { ptr, i32 } [ %17, %16 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %24

19:                                               ; preds = %21, %10
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %24

21:                                               ; preds = %13
  invoke void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(20) %3, i32 noundef 0)
          to label %22 unwind label %19

22:                                               ; preds = %21
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  br label %6, !llvm.loop !5

23:                                               ; preds = %9, %13
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret i1 %8

24:                                               ; preds = %19, %18
  %.pn8 = phi { ptr, i32 } [ %20, %19 ], [ %.pn, %18 ]
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn8
}

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

declare noundef zeroext i1 @_ZNK8orgQhull10QhullPointeqERKS0_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #3

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

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


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass