; LLVM IR from bldeng/AASolver :: AndersonOpt/external/OpenMesh/Core/Mesh (PolyConnectivity)

; 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.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54" = type { %"class.OpenMesh::Iterators::GenericCirculatorBaseT.base", %"struct.OpenMesh::FaceHandle" }
%"class.OpenMesh::Iterators::GenericCirculatorBaseT.base" = type <{ ptr, %"struct.OpenMesh::HalfedgeHandle", %"struct.OpenMesh::HalfedgeHandle", i32 }>
%"struct.OpenMesh::HalfedgeHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }
%"struct.OpenMesh::FaceHandle" = type { %"class.OpenMesh::BaseHandle" }
%"struct.OpenMesh::VertexHandle" = type { %"class.OpenMesh::BaseHandle" }

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; 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 @_ZN8OpenMesh16PolyConnectivity7vf_iterENS_12VertexHandleE(ptr dead_on_unwind noalias writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54") align 8, ptr noundef nonnull align 8 dereferenceable(416), i32) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh10BaseKernel19copy_all_propertiesENS_10FaceHandleES1_b(ptr noundef nonnull align 8 dereferenceable(168), i32, i32, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh16PolyConnectivity5splitENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416), i32, i32) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8OpenMesh16PolyConnectivity10split_copyENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i32 %2) #2 align 2 {
  %4 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %5 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %8 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %9 = alloca %"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54", align 8
  %10 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %11 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %12 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %13 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %4, i32 0, i32 0
  %14 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %13, i32 0, i32 0
  store i32 %1, ptr %14, align 4
  %15 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %5, i32 0, i32 0
  %16 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %15, i32 0, i32 0
  store i32 %2, ptr %16, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %4, i64 4, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %5, i64 4, i1 false)
  %18 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %7, i32 0, i32 0
  %19 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 4
  %21 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %8, i32 0, i32 0
  %22 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 4
  call void @_ZN8OpenMesh16PolyConnectivity5splitENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %17, i32 %20, i32 %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %5, i64 4, i1 false)
  %24 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %10, i32 0, i32 0
  %25 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 4
  call void @_ZN8OpenMesh16PolyConnectivity7vf_iterENS_12VertexHandleE(ptr dead_on_unwind writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54") align 8 %9, ptr noundef nonnull align 8 dereferenceable(416) %17, i32 %26)
  br label %27

27:                                               ; preds = %40, %3
  %28 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %27
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %4, i64 4, i1 false)
  %31 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %32 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %12, i32 0, i32 0
  %33 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %32, i32 0, i32 0
  store i32 %31, ptr %33, align 4
  %34 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %11, i32 0, i32 0
  %35 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 4
  %37 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %12, i32 0, i32 0
  %38 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4
  call void @_ZN8OpenMesh10BaseKernel19copy_all_propertiesENS_10FaceHandleES1_b(ptr noundef nonnull align 8 dereferenceable(168) %17, i32 %36, i32 %39, i1 noundef zeroext false)
  br label %40

40:                                               ; preds = %30
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  br label %27, !llvm.loop !9

42:                                               ; preds = %29
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54" = type { %"class.OpenMesh::Iterators::GenericCirculatorBaseT.base", %"struct.OpenMesh::FaceHandle" }
%"class.OpenMesh::Iterators::GenericCirculatorBaseT.base" = type <{ ptr, %"struct.OpenMesh::HalfedgeHandle", %"struct.OpenMesh::HalfedgeHandle", i32 }>
%"struct.OpenMesh::HalfedgeHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }
%"struct.OpenMesh::FaceHandle" = type { %"class.OpenMesh::BaseHandle" }

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

; 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 @_ZN8OpenMesh16PolyConnectivity7vf_iterENS_12VertexHandleE(ptr dead_on_unwind noalias writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54") align 8, ptr noundef nonnull align 8 dereferenceable(416), i32) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh16PolyConnectivity5splitENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416), i32, i32) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8OpenMesh16PolyConnectivity10split_copyENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i32 %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54", align 8
  tail call void @_ZN8OpenMesh16PolyConnectivity5splitENS_10FaceHandleENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i32 %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZN8OpenMesh16PolyConnectivity7vf_iterENS_12VertexHandleE(ptr dead_on_unwind nonnull writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED.54") align 8 %4, ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %2)
  %5 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  ret void

.lr.ph:                                           ; preds = %3, %.lr.ph
  %6 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @_ZN8OpenMesh10BaseKernel19copy_all_propertiesENS_10FaceHandleES1_b(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 %1, i32 %6, i1 noundef zeroext false)
  %7 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %8 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_10FaceHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E12toFaceHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  br i1 %8, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

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 = { 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: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass