; LLVM IR from Discngine/fpocket :: src/qhull/src/libqhullcpp/QhullFacet.ll (ZNK8orgQhull10QhullFacet10innerplaneEv)

; 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::QhullHyperplane" = type <{ ptr, ptr, double, i32, [4 x i8] }>
%"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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8orgQhull10QhullFacet10innerplaneEv(ptr dead_on_unwind noalias writable sret(%"class.orgQhull::QhullHyperplane") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.orgQhull::QhullHyperplane", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZN8orgQhull15QhullHyperplaneC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0)
  %11 = getelementptr inbounds %"class.orgQhull::QhullFacet", ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %42

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %15 = getelementptr inbounds %"class.orgQhull::QhullFacet", ptr %10, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = invoke noundef ptr @_ZNK8orgQhull10QhullFacet9getFacetTEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %18 unwind label %28

18:                                               ; preds = %14
  invoke void @qh_outerinner(ptr noundef %16, ptr noundef %17, ptr noundef null, ptr noundef %6)
          to label %19 unwind label %28

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  invoke void @_ZNK8orgQhull10QhullFacet10hyperplaneEv(ptr dead_on_unwind writable sret(%"class.orgQhull::QhullHyperplane") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %20 unwind label %32

20:                                               ; preds = %19
  %21 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN8orgQhull15QhullHyperplaneaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(28) %9)
          to label %22 unwind label %36

22:                                               ; preds = %20
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  %23 = invoke noundef double @_ZNK8orgQhull15QhullHyperplane6offsetEv(ptr noundef nonnull align 8 dereferenceable(28) %0)
          to label %24 unwind label %28

24:                                               ; preds = %22
  %25 = load double, ptr %6, align 8, !tbaa !11
  %26 = fsub double %23, %25
  invoke void @_ZN8orgQhull15QhullHyperplane9setOffsetEd(ptr noundef nonnull align 8 dereferenceable(28) %0, double noundef %26)
          to label %27 unwind label %28

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

28:                                               ; preds = %24, %22, %18, %14
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  br label %41

32:                                               ; preds = %19
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  br label %40

36:                                               ; preds = %20
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #4
  br label %40

40:                                               ; preds = %36, %32
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  br label %41

41:                                               ; preds = %40, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #4
  br label %46

42:                                               ; preds = %27, %2
  store i1 true, ptr %5, align 1
  %43 = load i1, ptr %5, align 1
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #4
  br label %45

45:                                               ; preds = %44, %42
  ret void

46:                                               ; preds = %41
  %47 = load ptr, ptr %7, align 8
  %48 = load i32, ptr %8, align 4
  %49 = insertvalue { ptr, i32 } poison, ptr %47, 0
  %50 = insertvalue { ptr, i32 } %49, i32 %48, 1
  resume { ptr, i32 } %50
}

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

declare void @qh_outerinner(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8orgQhull15QhullHyperplane9setOffsetEd(ptr noundef nonnull align 8 dereferenceable(28), double noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8orgQhull15QhullHyperplane6offsetEv(ptr noundef nonnull align 8 dereferenceable(28)) #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 = { "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 8}
!10 = !{!"_ZTSN8orgQhull10QhullFacetE", !6, i64 0, !6, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"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"

%"class.orgQhull::QhullHyperplane" = type <{ ptr, ptr, double, i32, [4 x i8] }>

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK8orgQhull10QhullFacet9getFacetTEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8orgQhull10QhullFacet10innerplaneEv(ptr dead_on_unwind noalias nonnull writable sret(%"class.orgQhull::QhullHyperplane") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca double, align 8
  %4 = alloca %"class.orgQhull::QhullHyperplane", align 8
  tail call void @_ZN8orgQhull15QhullHyperplaneC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0)
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %20, label %7

7:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %8 = tail call noundef ptr @_ZNK8orgQhull10QhullFacet9getFacetTEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  invoke void @qh_outerinner(ptr noundef nonnull %6, ptr noundef %8, ptr noundef null, ptr noundef nonnull %3)
          to label %9 unwind label %15

9:                                                ; preds = %7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZNK8orgQhull10QhullFacet10hyperplaneEv(ptr dead_on_unwind nonnull writable sret(%"class.orgQhull::QhullHyperplane") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %10 unwind label %17

10:                                               ; preds = %9
  %11 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN8orgQhull15QhullHyperplaneaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(28) %4)
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  %12 = call noundef double @_ZNK8orgQhull15QhullHyperplane6offsetEv(ptr noundef nonnull align 8 dereferenceable(28) %0)
  %13 = load double, ptr %3, align 8, !tbaa !10
  %14 = fsub double %12, %13
  call void @_ZN8orgQhull15QhullHyperplane9setOffsetEd(ptr noundef nonnull align 8 dereferenceable(28) %0, double noundef %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %20

15:                                               ; preds = %7
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %19

17:                                               ; preds = %9
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %19

19:                                               ; preds = %17, %15
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN8orgQhull15QhullHyperplaneD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #4
  resume { ptr, i32 } %.pn

20:                                               ; preds = %2, %10
  ret void
}

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

declare void @qh_outerinner(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8orgQhull15QhullHyperplane9setOffsetEd(ptr noundef nonnull align 8 dereferenceable(28), double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8orgQhull15QhullHyperplane6offsetEv(ptr noundef nonnull align 8 dereferenceable(28)) 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 = { "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 8}
!6 = !{!"_ZTSN8orgQhull10QhullFacetE", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass