; LLVM IR from bldeng/AASolver :: AndersonOpt/external/OpenMesh/Core/IO/writer (STLWriter)

; 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.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.OpenMesh::FaceHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }

@.str.19 = external hidden unnamed_addr constant [51 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

declare noundef nonnull align 8 dereferenceable(224) ptr @_Z5omerrv() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK8OpenMesh2IO11_STLWriter_11binary_sizeERNS0_12BaseExporterENS0_7OptionsE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::vector.18", align 8
  %12 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 48, ptr %8, align 8, !tbaa !9
  %16 = load i64, ptr %7, align 8, !tbaa !9
  %17 = add i64 %16, 80
  store i64 %17, ptr %7, align 8, !tbaa !9
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = add i64 %18, 4
  store i64 %19, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds ptr, ptr %21, i64 27
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef i64 %23(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %26

26:                                               ; preds = %58, %3
  %27 = load i32, ptr %9, align 4, !tbaa !13
  %28 = load i32, ptr %10, align 4, !tbaa !13
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %61

30:                                               ; preds = %26
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !13
  invoke void @_ZN8OpenMesh10FaceHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef %32)
          to label %33 unwind label %48

33:                                               ; preds = %30
  %34 = getelementptr inbounds %"struct.OpenMesh::FaceHandle", ptr %12, i32 0, i32 0
  %35 = getelementptr inbounds %"class.OpenMesh::BaseHandle", ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 4
  %37 = load ptr, ptr %31, align 8, !tbaa !11
  %38 = getelementptr inbounds ptr, ptr %37, i64 11
  %39 = load ptr, ptr %38, align 8
  %40 = invoke noundef i32 %39(ptr noundef nonnull align 8 dereferenceable(8) %31, i32 %36, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %41 unwind label %48

41:                                               ; preds = %33
  %42 = icmp eq i32 %40, 3
  br i1 %42, label %43, label %52

43:                                               ; preds = %41
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = add i64 %44, 2
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = add i64 %46, %45
  store i64 %47, ptr %7, align 8, !tbaa !9
  br label %57

48:                                               ; preds = %54, %52, %33, %30
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %13, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %14, align 4
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %63

52:                                               ; preds = %41
  %53 = invoke noundef nonnull align 8 dereferenceable(224) ptr @_Z5omerrv()
          to label %54 unwind label %48

54:                                               ; preds = %52
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.19)
          to label %56 unwind label %48

56:                                               ; preds = %54
  br label %57

57:                                               ; preds = %56, %43
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %9, align 4, !tbaa !13
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %9, align 4, !tbaa !13
  br label %26, !llvm.loop !15

61:                                               ; preds = %26
  %62 = load i64, ptr %7, align 8, !tbaa !9
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret i64 %62

63:                                               ; preds = %48
  %64 = load ptr, ptr %13, align 8
  %65 = load i32, ptr %14, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { "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 = { 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 #5 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl" }
%"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl" = type { %"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<OpenMesh::VertexHandle, std::allocator<OpenMesh::VertexHandle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.OpenMesh::FaceHandle" = type { %"class.OpenMesh::BaseHandle" }
%"class.OpenMesh::BaseHandle" = type { i32 }

@.str.19 = external hidden unnamed_addr constant [51 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(224) ptr @_Z5omerrv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK8OpenMesh2IO11_STLWriter_11binary_sizeERNS0_12BaseExporterENS0_7OptionsE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef readnone %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.18", align 8
  %5 = alloca %"struct.OpenMesh::FaceHandle", align 4
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 216
  %8 = load ptr, ptr %7, align 8
  %9 = tail call noundef i64 %8(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %10 = trunc i64 %9 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3, %28
  %.016 = phi i64 [ %.1, %28 ], [ 84, %3 ]
  %.01315 = phi i32 [ %29, %28 ], [ 0, %3 ]
  invoke void @_ZN8OpenMesh10FaceHandleC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %.01315)
          to label %12 unwind label %22

12:                                               ; preds = %.lr.ph
  %13 = load i32, ptr %5, align 4
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 88
  %16 = load ptr, ptr %15, align 8
  %17 = invoke noundef i32 %16(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 %13, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %18 unwind label %22

18:                                               ; preds = %12
  %19 = icmp eq i32 %17, 3
  br i1 %19, label %20, label %24

20:                                               ; preds = %18
  %21 = add i64 %.016, 50
  br label %28

22:                                               ; preds = %26, %24, %12, %.lr.ph
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %23

24:                                               ; preds = %18
  %25 = invoke noundef nonnull align 8 dereferenceable(224) ptr @_Z5omerrv()
          to label %26 unwind label %22

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @.str.19)
          to label %28 unwind label %22

28:                                               ; preds = %20, %26
  %.1 = phi i64 [ %21, %20 ], [ %.016, %26 ]
  %29 = add nuw nsw i32 %.01315, 1
  %exitcond.not = icmp eq i32 %29, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %28, %3
  %.0.lcssa = phi i64 [ 84, %3 ], [ %.1, %28 ]
  call void @_ZNSt6vectorIN8OpenMesh12VertexHandleESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret i64 %.0.lcssa
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { "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 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass