; 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" = 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 }
%"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: mustprogress uwtable
declare dso_local void @_ZNK8OpenMesh16PolyConnectivity9cvoh_iterENS_12VertexHandleE(ptr dead_on_unwind noalias writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED") align 8, ptr noundef nonnull align 8 dereferenceable(416), i32) #1 align 2

; 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) #2

; 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)) #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)) #1 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)) #1 align 2

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

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

17:                                               ; preds = %39, %2
  %18 = call noundef zeroext i1 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEE8is_validEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br i1 %18, label %20, label %19

19:                                               ; preds = %17
  store i32 2, ptr %7, align 4
  br label %41

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

28:                                               ; preds = %20
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %3, i64 4, i1 false)
  %29 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %30 = getelementptr inbounds %"struct.OpenMesh::HalfedgeHandle", ptr %10, i32 0, i32 0
  %31 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %30, i32 0, i32 0
  store i32 %29, ptr %31, align 4
  %32 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %9, i32 0, i32 0
  %33 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 4
  %35 = getelementptr inbounds %"struct.OpenMesh::HalfedgeHandle", ptr %10, i32 0, i32 0
  %36 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 4
  call void @_ZN8OpenMesh11ArrayKernel19set_halfedge_handleENS_12VertexHandleENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(368) %13, i32 %34, i32 %37)
  store i32 2, ptr %7, align 4
  br label %41

38:                                               ; preds = %20
  br label %39

39:                                               ; preds = %38
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEppEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br label %17, !llvm.loop !9

41:                                               ; preds = %28, %19
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #3
  br label %42

42:                                               ; preds = %41
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh11ArrayKernel19set_halfedge_handleENS_12VertexHandleENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(368), i32, i32) #1 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 void @_ZNK8OpenMesh16PolyConnectivity9cvoh_iterENS_12VertexHandleE(ptr dead_on_unwind noalias writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED") align 8, ptr noundef nonnull align 8 dereferenceable(416), i32) local_unnamed_addr #1 align 2

; 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
declare dso_local noundef zeroext i1 @_ZNK8OpenMesh16PolyConnectivity11is_boundaryENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(416), i32) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8OpenMesh16PolyConnectivity24adjust_outgoing_halfedgeENS_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 @_ZNK8OpenMesh16PolyConnectivity9cvoh_iterENS_12VertexHandleE(ptr dead_on_unwind nonnull writable sret(%"class.OpenMesh::Iterators::GenericCirculatorT_DEPRECATED") align 8 %3, ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1)
  %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 %.lr.ph, label %.loopexit

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

7:                                                ; preds = %.lr.ph
  %8 = call i32 @_ZNK8OpenMesh9Iterators29GenericCirculatorT_DEPRECATEDINS_16PolyConnectivityENS_12VertexHandleENS_14HalfedgeHandleEXadL_ZNKS0_22GenericCirculatorBaseTIS2_E16toHalfedgeHandleEvEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @_ZN8OpenMesh11ArrayKernel19set_halfedge_handleENS_12VertexHandleENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(368) %0, i32 %1, i32 %8)
  br label %.loopexit

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

.loopexit:                                        ; preds = %9, %2, %7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8OpenMesh11ArrayKernel19set_halfedge_handleENS_12VertexHandleENS_14HalfedgeHandleE(ptr noundef nonnull align 8 dereferenceable(368), i32, 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,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass