; LLVM IR from facebook/redex :: opt/object-escape-analysis (ObjectEscapeAnalysisImpl)

; 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.std::pair" = type <{ ptr, i8, [7 x i8] }>
%"struct.std::pair.56" = type { ptr, ptr }
%class.anon.58 = type { ptr, ptr, ptr, ptr, ptr }
%class.InsertOnlyConcurrentMap = type { %class.ConcurrentContainer.49 }
%class.ConcurrentContainer.49 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.50"] }
%"class.cc_impl::ConcurrentHashtable.50" = type { %"struct.std::atomic.51", %"struct.std::atomic.42", %"struct.std::atomic.44", %"struct.std::atomic.53" }
%"struct.std::atomic.51" = type { %"struct.std::__atomic_base.52" }
%"struct.std::__atomic_base.52" = type { ptr }
%"struct.std::atomic.42" = type { %"struct.std::__atomic_base.43" }
%"struct.std::__atomic_base.43" = type { i64 }
%"struct.std::atomic.44" = type { %"struct.std::__atomic_base.45" }
%"struct.std::__atomic_base.45" = type { i8 }
%"struct.std::atomic.53" = type { %"struct.std::__atomic_base.54" }
%"struct.std::__atomic_base.54" = type { ptr }

; 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: mustprogress uwtable
define dso_local { ptr, i8 } @_ZN27object_escape_analysis_impl21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeP9DexMethodPK7DexTypePA2_23InsertOnlyConcurrentMapISt4pairIS6_S9_ENS_7CalleesEN5boost4hashISC_EESt8equal_toISC_ELm83EE(ptr noundef nonnull align 8 dereferenceable(5984) %0, i16 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca %"struct.std::pair.56", align 8
  %14 = alloca %class.anon.58, align 8
  %15 = alloca { ptr, i8 }, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i16 %1, ptr %8, align 2, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %16 = load i16, ptr %8, align 2, !tbaa !9
  %17 = call noundef zeroext i1 @_ZN6opcode16is_invoke_staticE8IROpcode(i16 noundef zeroext %16)
  br i1 %17, label %24, label %18

18:                                               ; preds = %5
  %19 = load i16, ptr %8, align 2, !tbaa !9
  %20 = call noundef zeroext i1 @_ZN6opcode16is_invoke_directE8IROpcode(i16 noundef zeroext %19)
  br i1 %20, label %24, label %21

21:                                               ; preds = %18
  %22 = load i16, ptr %8, align 2, !tbaa !9
  %23 = call noundef zeroext i1 @_ZN6opcode15is_invoke_superE8IROpcode(i16 noundef zeroext %22)
  br label %24

24:                                               ; preds = %21, %18, %5
  %25 = phi i1 [ true, %18 ], [ true, %5 ], [ %23, %21 ]
  %26 = zext i1 %25 to i8
  store i8 %26, ptr %12, align 1, !tbaa !11
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  %30 = zext i1 %29 to i64
  %31 = getelementptr inbounds [2 x %class.InsertOnlyConcurrentMap], ptr %27, i64 0, i64 %30
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @_ZNSt4pairIP9DexMethodPK7DexTypeEC2IRS1_RS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  %32 = getelementptr inbounds %class.anon.58, ptr %14, i32 0, i32 0
  store ptr %9, ptr %32, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.anon.58, ptr %14, i32 0, i32 1
  store ptr %12, ptr %33, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.anon.58, ptr %14, i32 0, i32 2
  store ptr %8, ptr %34, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.anon.58, ptr %14, i32 0, i32 3
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %36, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.anon.58, ptr %14, i32 0, i32 4
  store ptr %10, ptr %37, align 8, !tbaa !5
  %38 = call { ptr, i8 } @"_ZN23InsertOnlyConcurrentMapISt4pairIP9DexMethodPK7DexTypeEN27object_escape_analysis_impl7CalleesEN5boost4hashIS6_EESt8equal_toIS6_ELm83EE30get_or_create_and_assert_equalISC_IS8_EZNS7_21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeS2_S5_PA2_SE_E3$_0JEEES0_IPKS8_bEOS6_RKT0_DpOT1_"(ptr noundef nonnull align 8 dereferenceable(2664) %31, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(40) %14)
  store { ptr, i8 } %38, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %15, i64 9, i1 false)
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  %39 = load { ptr, i8 }, ptr %6, align 8
  ret { ptr, i8 } %39
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode16is_invoke_staticE8IROpcode(i16 noundef zeroext) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode16is_invoke_directE8IROpcode(i16 noundef zeroext) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode15is_invoke_superE8IROpcode(i16 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZN23InsertOnlyConcurrentMapISt4pairIP9DexMethodPK7DexTypeEN27object_escape_analysis_impl7CalleesEN5boost4hashIS6_EESt8equal_toIS6_ELm83EE30get_or_create_and_assert_equalISC_IS8_EZNS7_21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeS2_S5_PA2_SE_E3$_0JEEES0_IPKS8_bEOS6_RKT0_DpOT1_"(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

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

; 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) #4

attributes #0 = { 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 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"_ZTS8IROpcode", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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.std::pair.56" = type { ptr, ptr }
%class.anon.58 = type { ptr, ptr, ptr, ptr, ptr }
%class.InsertOnlyConcurrentMap = type { %class.ConcurrentContainer.49 }
%class.ConcurrentContainer.49 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.50"] }
%"class.cc_impl::ConcurrentHashtable.50" = type { %"struct.std::atomic.51", %"struct.std::atomic.42", %"struct.std::atomic.44", %"struct.std::atomic.53" }
%"struct.std::atomic.51" = type { %"struct.std::__atomic_base.52" }
%"struct.std::__atomic_base.52" = type { ptr }
%"struct.std::atomic.42" = type { %"struct.std::__atomic_base.43" }
%"struct.std::__atomic_base.43" = type { i64 }
%"struct.std::atomic.44" = type { %"struct.std::__atomic_base.45" }
%"struct.std::__atomic_base.45" = type { i8 }
%"struct.std::atomic.53" = type { %"struct.std::__atomic_base.54" }
%"struct.std::__atomic_base.54" = type { ptr }

; 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
define dso_local { ptr, i8 } @_ZN27object_escape_analysis_impl21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeP9DexMethodPK7DexTypePA2_23InsertOnlyConcurrentMapISt4pairIS6_S9_ENS_7CalleesEN5boost4hashISC_EESt8equal_toISC_ELm83EE(ptr noundef nonnull align 8 dereferenceable(5984) %0, i16 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = alloca i16, align 2
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca %"struct.std::pair.56", align 8
  %11 = alloca %class.anon.58, align 8
  store i16 %1, ptr %6, align 2, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #4
  %12 = tail call noundef zeroext i1 @_ZN6opcode16is_invoke_staticE8IROpcode(i16 noundef zeroext %1)
  br i1 %12, label %17, label %13

13:                                               ; preds = %5
  %14 = tail call noundef zeroext i1 @_ZN6opcode16is_invoke_directE8IROpcode(i16 noundef zeroext %1)
  br i1 %14, label %17, label %15

15:                                               ; preds = %13
  %16 = tail call noundef zeroext i1 @_ZN6opcode15is_invoke_superE8IROpcode(i16 noundef zeroext %1)
  br label %17

17:                                               ; preds = %15, %13, %5
  %18 = phi i1 [ true, %13 ], [ true, %5 ], [ %16, %15 ]
  %19 = zext i1 %18 to i8
  store i8 %19, ptr %9, align 1, !tbaa !11
  %20 = zext i1 %18 to i64
  %21 = getelementptr inbounds [2 x %class.InsertOnlyConcurrentMap], ptr %4, i64 0, i64 %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZNSt4pairIP9DexMethodPK7DexTypeEC2IRS1_RS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #4
  store ptr %7, ptr %11, align 8, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %9, ptr %22, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %6, ptr %23, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr %0, ptr %24, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %11, i64 32
  store ptr %8, ptr %25, align 8, !tbaa !9
  %26 = call { ptr, i8 } @"_ZN23InsertOnlyConcurrentMapISt4pairIP9DexMethodPK7DexTypeEN27object_escape_analysis_impl7CalleesEN5boost4hashIS6_EESt8equal_toIS6_ELm83EE30get_or_create_and_assert_equalISC_IS8_EZNS7_21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeS2_S5_PA2_SE_E3$_0JEEES0_IPKS8_bEOS6_RKT0_DpOT1_"(ptr noundef nonnull align 8 dereferenceable(2664) %21, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(40) %11)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #4
  ret { ptr, i8 } %26
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode16is_invoke_staticE8IROpcode(i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode16is_invoke_directE8IROpcode(i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6opcode15is_invoke_superE8IROpcode(i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZN23InsertOnlyConcurrentMapISt4pairIP9DexMethodPK7DexTypeEN27object_escape_analysis_impl7CalleesEN5boost4hashIS6_EESt8equal_toIS6_ELm83EE30get_or_create_and_assert_equalISC_IS8_EZNS7_21get_or_create_calleesERKN21method_override_graph5GraphE8IROpcodeS2_S5_PA2_SE_E3$_0JEEES0_IPKS8_bEOS6_RKT0_DpOT1_"(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

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

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 = { 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 = { 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 = { 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 = !{!"_ZTS8IROpcode", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass