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

%"struct.OpenMesh::VertexHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }
%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED" = type { %"class.OpenMesh::Iterators::GenericCirculatorBaseT.base", %"struct.OpenMesh::HalfedgeHandle" }
%"class.OpenMesh::Iterators::GenericCirculatorBaseT.base" = type <{ ptr, %"struct.OpenMesh::HalfedgeHandle", %"struct.OpenMesh::HalfedgeHandle", i32 }>
%"struct.OpenMesh::HalfedgeHandle" = 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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 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
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_manifoldENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1) #2 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED", align 8
  %7 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %8 = alloca %"struct.OpenMesh::HalfedgeHandle", align 4
  %9 = alloca i32, align 4
  %10 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %4, i32 0, i32 0
  %11 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %10, i32 0, i32 0
  store i32 %1, ptr %11, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %4, i64 4, i1 false)
  %13 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %7, i32 0, i32 0
  %14 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 4
  call void @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEC2ERKS2_S3_b(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(416) %12, i32 %15, i1 noundef zeroext false)
  %16 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br i1 %16, label %17, label %34

17:                                               ; preds = %2
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br label %19

19:                                               ; preds = %31, %17
  %20 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br i1 %20, label %21, label %33

21:                                               ; preds = %19
  %22 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %23 = getelementptr inbounds %"struct.OpenMesh::HalfedgeHandle", ptr %8, i32 0, i32 0
  %24 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %23, i32 0, i32 0
  store i32 %22, ptr %24, align 4
  %25 = getelementptr inbounds %"struct.OpenMesh::HalfedgeHandle", ptr %8, i32 0, i32 0
  %26 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 4
  %28 = call noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_boundaryENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(416) %12, i32 %27)
  br i1 %28, label %29, label %30

29:                                               ; preds = %21
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %35

30:                                               ; preds = %21
  br label %31

31:                                               ; preds = %30
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br label %19, !llvm.loop !9

33:                                               ; preds = %19
  br label %34

34:                                               ; preds = %33, %2
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %35

35:                                               ; preds = %34, %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #3
  %36 = load i1, ptr %3, align 1
  ret i1 %36
}

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

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

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 = { 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" = type { %"class.OpenMesh::Iterators::GenericCirculatorBaseT.base", %"struct.OpenMesh::HalfedgeHandle" }
%"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 }

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_manifoldENS_12VertexHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #2
  call void @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEC2ERKS2_S3_b(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i1 noundef zeroext false)
  %4 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br i1 %4, label %5, label %.loopexit

5:                                                ; preds = %2
  %6 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %7 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br i1 %7, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %5, %10
  %8 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %9 = call noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_boundaryENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %8)
  br i1 %9, label %.loopexit.loopexit, label %10

10:                                               ; preds = %.lr.ph
  %11 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %12 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br i1 %12, label %.lr.ph, label %.loopexit.loopexit, !llvm.loop !5

.loopexit.loopexit:                               ; preds = %10, %.lr.ph
  %.0.ph = xor i1 %9, true
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %5, %2
  %.0 = phi i1 [ true, %2 ], [ true, %5 ], [ %.0.ph, %.loopexit.loopexit ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #2
  ret i1 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEC2ERKS2_S3_b(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(416), i32, i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_boundaryENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(416), i32) local_unnamed_addr #1 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 = { 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,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass