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

; 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::HalfedgeHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }
%"class.OpenMesh::ArrayKernel" = type { %"class.OpenMesh::BaseKernel", %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.10", %"struct.OpenMesh::VPropHandleT", %"struct.OpenMesh::HPropHandleT", %"struct.OpenMesh::EPropHandleT", %"struct.OpenMesh::FPropHandleT", i32, i32, i32, i32, %"class.std::vector.15", %"class.std::vector.15", %"class.std::vector.15", %"class.std::vector.15" }
%"class.OpenMesh::BaseKernel" = type { ptr, %"class.OpenMesh::PropertyContainer", %"class.OpenMesh::PropertyContainer", %"class.OpenMesh::PropertyContainer", %"class.OpenMesh::PropertyContainer", %"class.OpenMesh::PropertyContainer" }
%"class.OpenMesh::PropertyContainer" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<OpenMesh::BaseProperty *, std::allocator<OpenMesh::BaseProperty *>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::BaseProperty *, std::allocator<OpenMesh::BaseProperty *>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::BaseProperty *, std::allocator<OpenMesh::BaseProperty *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::BaseProperty *, std::allocator<OpenMesh::BaseProperty *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Vertex, std::allocator<OpenMesh::ArrayItems::Vertex>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Vertex, std::allocator<OpenMesh::ArrayItems::Vertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Vertex, std::allocator<OpenMesh::ArrayItems::Vertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Vertex, std::allocator<OpenMesh::ArrayItems::Vertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Edge, std::allocator<OpenMesh::ArrayItems::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Edge, std::allocator<OpenMesh::ArrayItems::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Edge, std::allocator<OpenMesh::ArrayItems::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Edge, std::allocator<OpenMesh::ArrayItems::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Face, std::allocator<OpenMesh::ArrayItems::Face>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Face, std::allocator<OpenMesh::ArrayItems::Face>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::ArrayItems::Face, std::allocator<OpenMesh::ArrayItems::Face>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::ArrayItems::Face, std::allocator<OpenMesh::ArrayItems::Face>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.OpenMesh::VPropHandleT" = type { %"struct.OpenMesh::BasePropHandleT" }
%"struct.OpenMesh::BasePropHandleT" = type { %"class.OpenMesh::BaseHandle" }
%"struct.OpenMesh::HPropHandleT" = type { %"struct.OpenMesh::BasePropHandleT" }
%"struct.OpenMesh::EPropHandleT" = type { %"struct.OpenMesh::BasePropHandleT" }
%"struct.OpenMesh::FPropHandleT" = type { %"struct.OpenMesh::BasePropHandleT" }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.OpenMesh::ArrayItems::Edge" = type { [2 x %"class.OpenMesh::ArrayItems::Halfedge_with_prev"] }
%"class.OpenMesh::ArrayItems::Halfedge_with_prev" = type { %"class.OpenMesh::ArrayItems::Halfedge_without_prev", %"struct.OpenMesh::HalfedgeHandle" }
%"class.OpenMesh::ArrayItems::Halfedge_without_prev" = type { %"struct.OpenMesh::FaceHandle", %"struct.OpenMesh::VertexHandle", %"struct.OpenMesh::HalfedgeHandle" }
%"struct.OpenMesh::FaceHandle" = type { %"class.OpenMesh::BaseHandle" }
%"struct.OpenMesh::VertexHandle" = type { %"class.OpenMesh::BaseHandle" }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [104 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE = external hidden unnamed_addr constant [69 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE(ptr noundef nonnull align 8 dereferenceable(368) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) #0 align 2 {
  %3 = alloca %"struct.OpenMesh::HalfedgeHandle", align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds %"class.OpenMesh::ArrayKernel", ptr %7, i32 0, i32 2
  %10 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %11 = ptrtoint ptr %8 to i64
  %12 = ptrtoint ptr %10 to i64
  %13 = sub i64 %11, %12
  %14 = udiv i64 %13, 32
  store i64 %14, ptr %6, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.OpenMesh::ArrayKernel", ptr %7, i32 0, i32 2
  %17 = load i64, ptr %6, align 8, !tbaa !9
  %18 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %17) #4
  %19 = getelementptr inbounds %"class.OpenMesh::ArrayItems::Edge", ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds [2 x %"class.OpenMesh::ArrayItems::Halfedge_with_prev"], ptr %19, i64 0, i64 0
  %21 = icmp eq ptr %15, %20
  br i1 %21, label %30, label %22

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.OpenMesh::ArrayKernel", ptr %7, i32 0, i32 2
  %25 = load i64, ptr %6, align 8, !tbaa !9
  %26 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %25) #4
  %27 = getelementptr inbounds %"class.OpenMesh::ArrayItems::Edge", ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds [2 x %"class.OpenMesh::ArrayItems::Halfedge_with_prev"], ptr %27, i64 0, i64 1
  %29 = icmp eq ptr %23, %28
  br label %30

30:                                               ; preds = %22, %2
  %31 = phi i1 [ true, %2 ], [ %29, %22 ]
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  br label %35

33:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 118, ptr noundef @__PRETTY_FUNCTION__._ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE) #5
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.OpenMesh::ArrayKernel", ptr %7, i32 0, i32 2
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %38) #4
  %40 = getelementptr inbounds %"class.OpenMesh::ArrayItems::Edge", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds [2 x %"class.OpenMesh::ArrayItems::Halfedge_with_prev"], ptr %40, i64 0, i64 0
  %42 = icmp eq ptr %36, %41
  br i1 %42, label %43, label %47

43:                                               ; preds = %35
  %44 = load i64, ptr %6, align 8, !tbaa !9
  %45 = trunc i64 %44 to i32
  %46 = shl i32 %45, 1
  call void @_ZN8OpenMesh14HalfedgeHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %46)
  br label %52

47:                                               ; preds = %35
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = trunc i64 %48 to i32
  %50 = shl i32 %49, 1
  %51 = add nsw i32 %50, 1
  call void @_ZN8OpenMesh14HalfedgeHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %51)
  br label %52

52:                                               ; preds = %47, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %53 = getelementptr inbounds %"struct.OpenMesh::HalfedgeHandle", ptr %3, i32 0, i32 0
  %54 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 4
  ret i32 %55
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8OpenMesh14HalfedgeHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #2 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn nounwind "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 }
attributes #5 = { noreturn 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, !10, i64 0}
!10 = !{!"long", !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"

%"struct.OpenMesh::HalfedgeHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [104 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE = external hidden unnamed_addr constant [69 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @_ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE(ptr noundef nonnull align 8 dereferenceable(368) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"struct.OpenMesh::HalfedgeHandle", align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 192
  %5 = tail call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %6 = ptrtoint ptr %1 to i64
  %7 = ptrtoint ptr %5 to i64
  %8 = sub i64 %6, %7
  %9 = lshr i64 %8, 5
  %10 = tail call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %11 = icmp eq ptr %10, %1
  br i1 %11, label %.critedge, label %12

12:                                               ; preds = %2
  %13 = tail call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = icmp eq ptr %14, %1
  br i1 %15, label %.critedge, label %16

16:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 118, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK8OpenMesh11ArrayKernel6handleERKNS_10ArrayItems18Halfedge_with_prevE) #3
  unreachable

.critedge:                                        ; preds = %2, %12
  %17 = tail call noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9) #2
  %18 = icmp ne ptr %17, %1
  %19 = trunc i64 %9 to i32
  %20 = shl i32 %19, 1
  %21 = zext i1 %18 to i32
  %.sink = or disjoint i32 %20, %21
  call void @_ZN8OpenMesh14HalfedgeHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %.sink)
  %22 = load i32, ptr %3, align 4
  ret i32 %22
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(32) ptr @_ZNKSt6vectorIN8OpenMesh10ArrayItems4EdgeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8OpenMesh14HalfedgeHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { noreturn nounwind "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 }
attributes #3 = { noreturn 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)"}


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