; LLVM IR from chensoft/libsocket :: lib/libchen/test/lib/googletest/googlemock/test (gmock_output_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.testing::internal::AnythingMatcher" = type { i8 }
%"class.testing::Matcher.11" = type { %"class.testing::internal::MatcherBase.12" }
%"class.testing::internal::MatcherBase.12" = type { ptr, %"class.testing::internal::linked_ptr.13" }
%"class.testing::internal::linked_ptr.13" = type { ptr, %"class.testing::internal::linked_ptr_internal" }
%"class.testing::internal::linked_ptr_internal" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [122 x i8], align 1
@_ZN7testingL1_E = external hidden constant %"class.testing::internal::AnythingMatcher", align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [5 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 noundef nonnull align 8 dereferenceable(56) ptr @_ZN7MockFoo10gmock_Bar2ERKN7testing7MatcherIiEES4_(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind noalias writable sret(%"class.testing::Matcher.11") align 8, ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZN7testing8internal8MockSpecIFbiiEE18InternalExpectedAtEPKciS5_S5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7MockFoo4Bar2Eii(ptr noundef nonnull align 8 dereferenceable(408), i32 noundef, i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z34TestCatchesLeakedMocksInAdHocTestsv() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.testing::Matcher.11", align 8
  %5 = alloca %"class.testing::Matcher.11", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %6 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 408) #6
  invoke void @_ZN7MockFooC2Ev(ptr noundef nonnull align 8 dereferenceable(408) %6)
          to label %7 unwind label %16

7:                                                ; preds = %0
  store ptr %6, ptr %1, align 8, !tbaa !5
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind writable sret(%"class.testing::Matcher.11") align 8 %4, ptr noundef nonnull align 1 dereferenceable(1) @_ZN7testingL1_E)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  invoke void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind writable sret(%"class.testing::Matcher.11") align 8 %5, ptr noundef nonnull align 1 dereferenceable(1) @_ZN7testingL1_E)
          to label %9 unwind label %20

9:                                                ; preds = %7
  %10 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN7MockFoo10gmock_Bar2ERKN7testing7MatcherIiEES4_(ptr noundef nonnull align 8 dereferenceable(408) %8, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %11 unwind label %24

11:                                               ; preds = %9
  %12 = invoke noundef nonnull align 8 dereferenceable(328) ptr @_ZN7testing8internal8MockSpecIFbiiEE18InternalExpectedAtEPKciS5_S5_(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef @.str.3, i32 noundef 275, ptr noundef @.str.65, ptr noundef @.str.13)
          to label %13 unwind label %24

13:                                               ; preds = %11
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = call noundef zeroext i1 @_ZN7MockFoo4Bar2Eii(ptr noundef nonnull align 8 dereferenceable(408) %14, i32 noundef 2, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          cleanup
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %2, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %3, align 4
  call void @_ZdlPvm(ptr noundef %6, i64 noundef 408) #7
  br label %29

20:                                               ; preds = %7
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %2, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %3, align 4
  br label %28

24:                                               ; preds = %11, %9
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %2, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %3, align 4
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %28

28:                                               ; preds = %24, %20
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  br label %29

29:                                               ; preds = %28, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %2, align 8
  %32 = load i32, ptr %3, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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"}


; 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.testing::internal::AnythingMatcher" = type { i8 }
%"class.testing::Matcher.11" = type { %"class.testing::internal::MatcherBase.12" }
%"class.testing::internal::MatcherBase.12" = type { ptr, %"class.testing::internal::linked_ptr.13" }
%"class.testing::internal::linked_ptr.13" = type { ptr, %"class.testing::internal::linked_ptr_internal" }
%"class.testing::internal::linked_ptr_internal" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [122 x i8], align 1
@_ZN7testingL1_E = external hidden constant %"class.testing::internal::AnythingMatcher", align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [5 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 noundef nonnull align 8 dereferenceable(56) ptr @_ZN7MockFoo10gmock_Bar2ERKN7testing7MatcherIiEES4_(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind noalias writable sret(%"class.testing::Matcher.11") align 8, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZN7testing8internal8MockSpecIFbiiEE18InternalExpectedAtEPKciS5_S5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7MockFoo4Bar2Eii(ptr noundef nonnull align 8 dereferenceable(408), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z34TestCatchesLeakedMocksInAdHocTestsv() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.testing::Matcher.11", align 8
  %2 = alloca %"class.testing::Matcher.11", align 8
  %3 = tail call noalias noundef nonnull dereferenceable(408) ptr @_Znwm(i64 noundef 408) #5
  invoke void @_ZN7MockFooC2Ev(ptr noundef nonnull align 8 dereferenceable(408) %3)
          to label %4 unwind label %11

4:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind nonnull writable sret(%"class.testing::Matcher.11") align 8 %1, ptr noundef nonnull align 1 dereferenceable(1) @_ZN7testingL1_E)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  invoke void @_ZNK7testing8internal15AnythingMatchercvNS_7MatcherIT_EEIiEEv(ptr dead_on_unwind nonnull writable sret(%"class.testing::Matcher.11") align 8 %2, ptr noundef nonnull align 1 dereferenceable(1) @_ZN7testingL1_E)
          to label %5 unwind label %13

5:                                                ; preds = %4
  %6 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN7MockFoo10gmock_Bar2ERKN7testing7MatcherIiEES4_(ptr noundef nonnull align 8 dereferenceable(408) %3, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %7 unwind label %15

7:                                                ; preds = %5
  %8 = invoke noundef nonnull align 8 dereferenceable(328) ptr @_ZN7testing8internal8MockSpecIFbiiEE18InternalExpectedAtEPKciS5_S5_(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull @.str.3, i32 noundef 275, ptr noundef nonnull @.str.65, ptr noundef nonnull @.str.13)
          to label %9 unwind label %15

9:                                                ; preds = %7
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  %10 = call noundef zeroext i1 @_ZN7MockFoo4Bar2Eii(ptr noundef nonnull align 8 dereferenceable(408) %3, i32 noundef 2, i32 noundef 1)
  ret void

11:                                               ; preds = %0
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 408) #7
  br label %18

13:                                               ; preds = %4
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %17

15:                                               ; preds = %7, %5
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %17

17:                                               ; preds = %15, %13
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZN7testing8internal11MatcherBaseIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  br label %18

18:                                               ; preds = %17, %11
  %.pn.pn = phi { ptr, i32 } [ %.pn, %17 ], [ %12, %11 ]
  resume { ptr, i32 } %.pn.pn
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { builtin allocsize(0) }
attributes #6 = { nounwind }
attributes #7 = { 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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass