; 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 }>
%"class.orgQhull::QhullPointsIterator" = type { ptr, %"class.orgQhull::QhullPoints::const_iterator" }

; 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 @_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
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 uwtable
define dso_local noundef zeroext i1 @_ZN8orgQhull19QhullPointsIterator8findNextERKNS_10QhullPointE(ptr noundef nonnull align 8 dereferenceable(32) %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 ptr, align 8
  %8 = alloca i32, align 4
  %9 = 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
  %10 = load ptr, ptr %4, align 8
  br label %11

11:                                               ; preds = %33, %2
  %12 = getelementptr inbounds %"class.orgQhull::QhullPointsIterator", ptr %10, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #4
  %13 = getelementptr inbounds %"class.orgQhull::QhullPointsIterator", ptr %10, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZNK8orgQhull11QhullPoints8constEndEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(28) %14)
  %15 = invoke noundef zeroext i1 @_ZNK8orgQhull11QhullPoints14const_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %12, ptr noundef nonnull align 8 dereferenceable(20) %6)
          to label %16 unwind label %25

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

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  %18 = getelementptr inbounds %"class.orgQhull::QhullPointsIterator", ptr %10, i32 0, i32 1
  call void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(20) %18, i32 noundef 0)
  %19 = invoke noundef nonnull align 8 dereferenceable(20) ptr @_ZNK8orgQhull11QhullPoints14const_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(20) %9)
          to label %20 unwind label %29

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

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

24:                                               ; preds = %23
  store i1 true, ptr %3, align 1
  br label %35

25:                                               ; preds = %11
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %7, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %8, align 4
  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 %37

29:                                               ; preds = %20, %17
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %7, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %8, align 4
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  br label %37

33:                                               ; preds = %23
  br label %11, !llvm.loop !14

34:                                               ; preds = %16
  store i1 false, ptr %3, align 1
  br label %35

35:                                               ; preds = %34, %24
  %36 = load i1, ptr %3, align 1
  ret i1 %36

37:                                               ; preds = %29, %25
  %38 = load ptr, ptr %7, align 8
  %39 = load i32, ptr %8, align 4
  %40 = insertvalue { ptr, i32 } poison, ptr %38, 0
  %41 = insertvalue { ptr, i32 } %40, i32 %39, 1
  resume { ptr, i32 } %41
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints8constEndEv(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 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN8orgQhull19QhullPointsIteratorE", !6, i64 0, !11, i64 8}
!11 = !{!"_ZTSN8orgQhull11QhullPoints14const_iteratorE", !12, i64 0}
!12 = !{!"_ZTSN8orgQhull10QhullPointE", !6, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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 @_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
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 uwtable
define dso_local noundef zeroext i1 @_ZN8orgQhull19QhullPointsIterator8findNextERKNS_10QhullPointE(ptr noundef nonnull align 8 dereferenceable(32) %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 = getelementptr inbounds i8, ptr %0, i64 8
  br label %6

6:                                                ; preds = %13, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZNK8orgQhull11QhullPoints8constEndEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(28) %7)
  %8 = invoke noundef zeroext i1 @_ZNK8orgQhull11QhullPoints14const_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(20) %3)
          to label %9 unwind label %14

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

10:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZN8orgQhull11QhullPoints14const_iteratorppEi(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullPoints::const_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(20) %5, i32 noundef 0)
  %11 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK8orgQhull11QhullPoints14const_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(20) %4)
  %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 %16

13:                                               ; preds = %10
  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 %12, label %18, label %6, !llvm.loop !13

14:                                               ; preds = %6
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8orgQhull10QhullPointD2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  br label %19

16:                                               ; preds = %10
  %17 = landingpad { ptr, i32 }
          cleanup
  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 label %19

18:                                               ; preds = %9, %13
  ret i1 %8

19:                                               ; preds = %16, %14
  %.pn = phi { ptr, i32 } [ %17, %16 ], [ %15, %14 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8orgQhull11QhullPoints8constEndEv(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 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 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN8orgQhull19QhullPointsIteratorE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8orgQhull11QhullPoints14const_iteratorE", !11, i64 0}
!11 = !{!"_ZTSN8orgQhull10QhullPointE", !7, i64 0, !7, i64 8, !12, i64 16}
!12 = !{!"int", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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