; 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::FaceHandle" = 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: 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 i32 @_ZN8OpenMesh16PolyConnectivity8add_faceEPKNS_12VertexHandleEm(ptr noundef nonnull align 8 dereferenceable(416), ptr noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN8OpenMesh16PolyConnectivity8add_faceENS_12VertexHandleES1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i32 %2, i32 %3, i32 %4) #2 align 2 {
  %6 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %7 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %8 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %9 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %10 = alloca %"struct.OpenMesh::VertexHandle", align 4
  %11 = alloca ptr, align 8
  %12 = alloca [4 x %"struct.OpenMesh::VertexHandle"], align 16
  %13 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %7, 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 %8, i32 0, i32 0
  %16 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %15, i32 0, i32 0
  store i32 %2, ptr %16, align 4
  %17 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %9, i32 0, i32 0
  %18 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %17, i32 0, i32 0
  store i32 %3, ptr %18, align 4
  %19 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %10, i32 0, i32 0
  %20 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %19, i32 0, i32 0
  store i32 %4, ptr %20, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  %21 = load ptr, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %7, i64 4, i1 false)
  %22 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %12, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %8, i64 4, i1 false)
  %23 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %12, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %9, i64 4, i1 false)
  %24 = getelementptr inbounds %"struct.OpenMesh::VertexHandle", ptr %12, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %10, i64 4, i1 false)
  %25 = getelementptr inbounds [4 x %"struct.OpenMesh::VertexHandle"], ptr %12, i64 0, i64 0
  %26 = call i32 @_ZN8OpenMesh16PolyConnectivity8add_faceEPKNS_12VertexHandleEm(ptr noundef nonnull align 8 dereferenceable(416) %21, ptr noundef %25, i64 noundef 4)
  %27 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %6, i32 0, i32 0
  %28 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %27, i32 0, i32 0
  store i32 %26, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  %29 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %6, i32 0, i32 0
  %30 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 4
  ret i32 %31
}

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


; 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::VertexHandle" = 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 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 i32 @_ZN8OpenMesh16PolyConnectivity8add_faceEPKNS_12VertexHandleEm(ptr noundef nonnull align 8 dereferenceable(416), ptr noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN8OpenMesh16PolyConnectivity8add_faceENS_12VertexHandleES1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(416) %0, i32 %1, i32 %2, i32 %3, i32 %4) local_unnamed_addr #1 align 2 {
  %6 = alloca [4 x %"struct.OpenMesh::VertexHandle"], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #2
  store i32 %1, ptr %6, align 16
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %2, ptr %7, align 4
  %8 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %3, ptr %8, align 8
  %9 = getelementptr inbounds i8, ptr %6, i64 12
  store i32 %4, ptr %9, align 4
  %10 = call i32 @_ZN8OpenMesh16PolyConnectivity8add_faceEPKNS_12VertexHandleEm(ptr noundef nonnull align 8 dereferenceable(416) %0, ptr noundef nonnull %6, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #2
  ret i32 %10
}

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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass