; LLVM IR from chensoft/libsocket :: lib/libchen/test/lib/googletest/googletest/test (gtest-death-test_test)

; 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.MockDeathTestFactory = type <{ %"class.testing::internal::DeathTestFactory", i8, [3 x i8], i32, i32, i8, [3 x i8], i32, i32, %"class.std::vector.57", %"class.std::vector.61", i8, [7 x i8] }>
%"class.testing::internal::DeathTestFactory" = type { ptr }
%"class.std::vector.57" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.61" = type { %"struct.std::_Vector_base.62" }
%"struct.std::_Vector_base.62" = type { %"struct.std::_Vector_base<testing::internal::DeathTest::AbortReason, std::allocator<testing::internal::DeathTest::AbortReason>>::_Vector_impl" }
%"struct.std::_Vector_base<testing::internal::DeathTest::AbortReason, std::allocator<testing::internal::DeathTest::AbortReason>>::_Vector_impl" = type { %"struct.std::_Vector_base<testing::internal::DeathTest::AbortReason, std::allocator<testing::internal::DeathTest::AbortReason>>::_Vector_impl_data" }
%"struct.std::_Vector_base<testing::internal::DeathTest::AbortReason, std::allocator<testing::internal::DeathTest::AbortReason>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTV20MockDeathTestFactory = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN20MockDeathTestFactoryC2Ev(ptr noundef nonnull align 8 dereferenceable(97) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  call void @_ZN7testing8internal16DeathTestFactoryC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTV20MockDeathTestFactory, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 1
  store i8 1, ptr %4, align 8, !tbaa !11
  %5 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 3
  store i32 0, ptr %5, align 4, !tbaa !27
  %6 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 4
  store i32 0, ptr %6, align 8, !tbaa !28
  %7 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 5
  store i8 1, ptr %7, align 4, !tbaa !29
  %8 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 7
  store i32 0, ptr %8, align 8, !tbaa !30
  %9 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 8
  store i32 0, ptr %9, align 4, !tbaa !31
  %10 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 9
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 40, i1 false)
  call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #3
  %11 = getelementptr inbounds %class.MockDeathTestFactory, ptr %3, i32 0, i32 10
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIN7testing8internal9DeathTest11AbortReasonESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !14, i64 8}
!12 = !{!"_ZTS20MockDeathTestFactory", !13, i64 0, !14, i64 8, !15, i64 12, !16, i64 16, !14, i64 20, !16, i64 24, !16, i64 28, !17, i64 32, !23, i64 72, !14, i64 96}
!13 = !{!"_ZTSN7testing8internal16DeathTestFactoryE"}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN7testing8internal9DeathTest8TestRoleE", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIbSaIbEE", !18, i64 0}
!18 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !19, i64 0}
!19 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !21, i64 0, !21, i64 16, !6, i64 32}
!21 = !{!"_ZTSSt13_Bit_iterator", !22, i64 0}
!22 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !16, i64 8}
!23 = !{!"_ZTSSt6vectorIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!12, !15, i64 12}
!28 = !{!12, !16, i64 16}
!29 = !{!12, !14, i64 20}
!30 = !{!12, !16, i64 24}
!31 = !{!12, !16, i64 28}


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

@_ZTV20MockDeathTestFactory = external dso_local unnamed_addr constant { [5 x ptr] }, align 8

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN20MockDeathTestFactoryC2Ev(ptr noundef nonnull align 8 dereferenceable(97) %0) unnamed_addr #1 align 2 {
  tail call void @_ZN7testing8internal16DeathTestFactoryC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #3
  store ptr getelementptr inbounds inrange(-16, 24) (i8, ptr @_ZTV20MockDeathTestFactory, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  store i8 1, ptr %2, align 8, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %3, align 4, !tbaa !26
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %4, align 8, !tbaa !27
  %5 = getelementptr inbounds i8, ptr %0, i64 20
  store i8 1, ptr %5, align 4, !tbaa !28
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 48, i1 false)
  tail call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  tail call void @_ZNSt6vectorIN7testing8internal9DeathTest11AbortReasonESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = !{!9, !11, i64 8}
!9 = !{!"_ZTS20MockDeathTestFactory", !10, i64 0, !11, i64 8, !13, i64 12, !14, i64 16, !11, i64 20, !14, i64 24, !14, i64 28, !15, i64 32, !22, i64 72, !11, i64 96}
!10 = !{!"_ZTSN7testing8internal16DeathTestFactoryE"}
!11 = !{!"bool", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"_ZTSN7testing8internal9DeathTest8TestRoleE", !12, i64 0}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTSSt6vectorIbSaIbEE", !16, i64 0}
!16 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !17, i64 0}
!17 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !19, i64 0, !19, i64 16, !21, i64 32}
!19 = !{!"_ZTSSt13_Bit_iterator", !20, i64 0}
!20 = !{!"_ZTSSt18_Bit_iterator_base", !21, i64 0, !14, i64 8}
!21 = !{!"any pointer", !12, i64 0}
!22 = !{!"_ZTSSt6vectorIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE17_Vector_impl_dataE", !21, i64 0, !21, i64 8, !21, i64 16}
!26 = !{!9, !13, i64 12}
!27 = !{!9, !14, i64 16}
!28 = !{!9, !11, i64 20}


; Effective O3 passes: InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass