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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN20MockDeathTestFactory6CreateEPKcPKN7testing8internal2REES1_iPPNS3_9DeathTestE(ptr noundef nonnull align 8 dereferenceable(97) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8
  %16 = getelementptr inbounds %class.MockDeathTestFactory, ptr %15, i32 0, i32 11
  store i8 0, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds %class.MockDeathTestFactory, ptr %15, i32 0, i32 1
  %18 = load i8, ptr %17, align 8, !tbaa !26, !range !27, !noundef !28
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %35

20:                                               ; preds = %6
  %21 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #3
  %22 = getelementptr inbounds %class.MockDeathTestFactory, ptr %15, i32 0, i32 3
  %23 = load i32, ptr %22, align 4, !tbaa !29
  %24 = getelementptr inbounds %class.MockDeathTestFactory, ptr %15, i32 0, i32 4
  %25 = load i32, ptr %24, align 8, !tbaa !30
  %26 = getelementptr inbounds %class.MockDeathTestFactory, ptr %15, i32 0, i32 5
  %27 = load i8, ptr %26, align 4, !tbaa !31, !range !27, !noundef !28
  %28 = trunc i8 %27 to i1
  invoke void @_ZN13MockDeathTestC2EP20MockDeathTestFactoryN7testing8internal9DeathTest8TestRoleEib(ptr noundef nonnull align 8 dereferenceable(25) %21, ptr noundef %15, i32 noundef %23, i32 noundef %25, i1 noundef zeroext %28)
          to label %29 unwind label %31

29:                                               ; preds = %20
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %21, ptr %30, align 8, !tbaa !5
  br label %37

31:                                               ; preds = %20
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %13, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %21, i64 noundef 32) #4
  br label %38

35:                                               ; preds = %6
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr null, ptr %36, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %35, %29
  ret i1 true

38:                                               ; preds = %31
  %39 = load ptr, ptr %13, align 8
  %40 = load i32, ptr %14, align 4
  %41 = insertvalue { ptr, i32 } poison, ptr %39, 0
  %42 = insertvalue { ptr, i32 } %41, i32 %40, 1
  resume { ptr, i32 } %42
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13MockDeathTestC2EP20MockDeathTestFactoryN7testing8internal9DeathTest8TestRoleEib(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #2 align 2

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 = { builtin allocsize(0) }
attributes #4 = { builtin 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 = !{!"int", !7, i64 0}
!11 = !{!12, !14, i64 96}
!12 = !{!"_ZTS20MockDeathTestFactory", !13, i64 0, !14, i64 8, !15, i64 12, !10, i64 16, !14, i64 20, !10, i64 24, !10, i64 28, !16, i64 32, !22, i64 72, !14, i64 96}
!13 = !{!"_ZTSN7testing8internal16DeathTestFactoryE"}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN7testing8internal9DeathTest8TestRoleE", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIbSaIbEE", !17, i64 0}
!17 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !18, i64 0}
!18 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !20, i64 0, !20, i64 16, !6, i64 32}
!20 = !{!"_ZTSSt13_Bit_iterator", !21, i64 0}
!21 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !10, i64 8}
!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", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!12, !14, i64 8}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!12, !15, i64 12}
!30 = !{!12, !10, i64 16}
!31 = !{!12, !14, i64 20}


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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN20MockDeathTestFactory6CreateEPKcPKN7testing8internal2REES1_iPPNS3_9DeathTestE(ptr noundef nonnull align 8 dereferenceable(97) %0, ptr nocapture noundef readnone %1, ptr nocapture noundef readnone %2, ptr nocapture noundef readnone %3, i32 noundef %4, ptr nocapture noundef writeonly %5) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  store i8 0, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i8, ptr %8, align 8, !tbaa !24, !range !25, !noundef !26
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %22

11:                                               ; preds = %6
  %12 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #3
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  %14 = load i32, ptr %13, align 4, !tbaa !27
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !28
  %17 = getelementptr inbounds i8, ptr %0, i64 20
  %18 = load i8, ptr %17, align 4, !tbaa !29, !range !25, !noundef !26
  %19 = trunc nuw i8 %18 to i1
  invoke void @_ZN13MockDeathTestC2EP20MockDeathTestFactoryN7testing8internal9DeathTest8TestRoleEib(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull %0, i32 noundef %14, i32 noundef %16, i1 noundef zeroext %19)
          to label %22 unwind label %20

20:                                               ; preds = %11
  %21 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %12, i64 noundef 32) #4
  resume { ptr, i32 } %21

22:                                               ; preds = %6, %11
  %storemerge = phi ptr [ %12, %11 ], [ null, %6 ]
  store ptr %storemerge, ptr %5, align 8, !tbaa !30
  ret i1 true
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13MockDeathTestC2EP20MockDeathTestFactoryN7testing8internal9DeathTest8TestRoleEib(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #2 align 2

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 = { builtin allocsize(0) }
attributes #4 = { builtin 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, !8, i64 96}
!6 = !{!"_ZTS20MockDeathTestFactory", !7, i64 0, !8, i64 8, !11, i64 12, !12, i64 16, !8, i64 20, !12, i64 24, !12, i64 28, !13, i64 32, !20, i64 72, !8, i64 96}
!7 = !{!"_ZTSN7testing8internal16DeathTestFactoryE"}
!8 = !{!"bool", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN7testing8internal9DeathTest8TestRoleE", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !19, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !19, i64 0, !12, i64 8}
!19 = !{!"any pointer", !9, i64 0}
!20 = !{!"_ZTSSt6vectorIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7testing8internal9DeathTest11AbortReasonESaIS3_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!24 = !{!6, !8, i64 8}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!6, !11, i64 12}
!28 = !{!6, !12, i64 16}
!29 = !{!6, !8, i64 20}
!30 = !{!19, !19, i64 0}


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