; LLVM IR from facebook/redex :: service/constant-propagation (ConstantPropagationAnalysis)

; 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.constant_propagation::ImmutableAttributeAnalyzerState" = type { %class.ConcurrentMap.363, %class.ConcurrentSet.371, %class.ConcurrentSet.379, %class.UnorderedMap.387, %class.ConcurrentSet.403, %class.InsertOnlyConcurrentMap }
%class.ConcurrentMap.363 = type { %class.ConcurrentContainer.364, [83 x %"class.std::mutex"] }
%class.ConcurrentContainer.364 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.365"] }
%"class.cc_impl::ConcurrentHashtable.365" = type { %"struct.std::atomic.366", %"struct.std::atomic.130", %"struct.std::atomic.132", %"struct.std::atomic.368" }
%"struct.std::atomic.366" = type { %"struct.std::__atomic_base.367" }
%"struct.std::__atomic_base.367" = type { ptr }
%"struct.std::atomic.130" = type { %"struct.std::__atomic_base.131" }
%"struct.std::__atomic_base.131" = type { i64 }
%"struct.std::atomic.132" = type { %"struct.std::__atomic_base.133" }
%"struct.std::__atomic_base.133" = type { i8 }
%"struct.std::atomic.368" = type { %"struct.std::__atomic_base.369" }
%"struct.std::__atomic_base.369" = type { ptr }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%class.ConcurrentSet.371 = type { %class.ConcurrentContainer.372 }
%class.ConcurrentContainer.372 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.373"] }
%"class.cc_impl::ConcurrentHashtable.373" = type { %"struct.std::atomic.374", %"struct.std::atomic.130", %"struct.std::atomic.132", %"struct.std::atomic.376" }
%"struct.std::atomic.374" = type { %"struct.std::__atomic_base.375" }
%"struct.std::__atomic_base.375" = type { ptr }
%"struct.std::atomic.376" = type { %"struct.std::__atomic_base.377" }
%"struct.std::__atomic_base.377" = type { ptr }
%class.ConcurrentSet.379 = type { %class.ConcurrentContainer.380 }
%class.ConcurrentContainer.380 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.381"] }
%"class.cc_impl::ConcurrentHashtable.381" = type { %"struct.std::atomic.382", %"struct.std::atomic.130", %"struct.std::atomic.132", %"struct.std::atomic.384" }
%"struct.std::atomic.382" = type { %"struct.std::__atomic_base.383" }
%"struct.std::__atomic_base.383" = type { ptr }
%"struct.std::atomic.384" = type { %"struct.std::__atomic_base.385" }
%"struct.std::__atomic_base.385" = type { ptr }
%class.UnorderedMap.387 = type { %"class.std::unordered_map.389" }
%"class.std::unordered_map.389" = type { %"class.std::_Hashtable.390" }
%"class.std::_Hashtable.390" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%class.ConcurrentSet.403 = type { %class.ConcurrentContainer.404 }
%class.ConcurrentContainer.404 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.405"] }
%"class.cc_impl::ConcurrentHashtable.405" = type { %"struct.std::atomic.406", %"struct.std::atomic.130", %"struct.std::atomic.132", %"struct.std::atomic.408" }
%"struct.std::atomic.406" = type { %"struct.std::__atomic_base.407" }
%"struct.std::__atomic_base.407" = type { ptr }
%"struct.std::atomic.408" = type { %"struct.std::__atomic_base.409" }
%"struct.std::__atomic_base.409" = type { ptr }
%class.InsertOnlyConcurrentMap = type { %class.ConcurrentContainer.411 }
%class.ConcurrentContainer.411 = type { ptr, [83 x %"class.cc_impl::ConcurrentHashtable.412"] }
%"class.cc_impl::ConcurrentHashtable.412" = type { %"struct.std::atomic.413", %"struct.std::atomic.130", %"struct.std::atomic.132", %"struct.std::atomic.415" }
%"struct.std::atomic.413" = type { %"struct.std::__atomic_base.414" }
%"struct.std::__atomic_base.414" = type { ptr }
%"struct.std::atomic.415" = type { %"struct.std::__atomic_base.416" }
%"struct.std::__atomic_base.416" = 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
declare dso_local noundef ptr @_ZNK13IRInstruction10get_methodEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z14resolve_methodP12DexMethodRef12MethodSearchPK9DexMethod(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z16opcode_to_searchPK13IRInstruction(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer14analyze_invokeEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironment(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = call noundef ptr @_ZNK13IRInstruction10get_methodEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  store ptr %12, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = call noundef i32 @_Z16opcode_to_searchPK13IRInstruction(ptr noundef %14)
  %16 = call noundef ptr @_Z14resolve_methodP12DexMethodRef12MethodSearchPK9DexMethod(ptr noundef %13, i32 noundef %15, ptr noundef null)
  store ptr %16, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %21, label %19

19:                                               ; preds = %3
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %20, ptr %9, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %19, %3
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.constant_propagation::ImmutableAttributeAnalyzerState", ptr %22, i32 0, i32 0
  %24 = call noundef i64 @_ZNK19ConcurrentContainerISt13unordered_mapIP9DexMethodSt6vectorISt10unique_ptrIN20constant_propagation31ImmutableAttributeAnalyzerState11InitializerESt14default_deleteIS7_EESaISA_EESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_SC_EEELm83EE12count_unsafeERSI_(ptr noundef nonnull align 8 dereferenceable(2664) %23, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %26, label %32

26:                                               ; preds = %21
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer29analyze_method_initializationEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef %27, ptr noundef %28, ptr noundef %29, ptr noundef %30)
  store i1 %31, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %45

32:                                               ; preds = %21
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.constant_propagation::ImmutableAttributeAnalyzerState", ptr %33, i32 0, i32 1
  %35 = call noundef i64 @_ZNK19ConcurrentContainerISt13unordered_setIP9DexMethodSt4hashIS2_ESt8equal_toIS2_ESaIS2_EELm83EE12count_unsafeERKS2_(ptr noundef nonnull align 8 dereferenceable(2664) %34, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %43

37:                                               ; preds = %32
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = call noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer19analyze_method_attrEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef %38, ptr noundef %39, ptr noundef %40, ptr noundef %41)
  store i1 %42, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %45

43:                                               ; preds = %32
  br label %44

44:                                               ; preds = %43
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %45

45:                                               ; preds = %44, %37, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %46 = load i1, ptr %4, align 1
  ret i1 %46
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK19ConcurrentContainerISt13unordered_mapIP9DexMethodSt6vectorISt10unique_ptrIN20constant_propagation31ImmutableAttributeAnalyzerState11InitializerESt14default_deleteIS7_EESaISA_EESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_SC_EEELm83EE12count_unsafeERSI_(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer29analyze_method_initializationEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK19ConcurrentContainerISt13unordered_setIP9DexMethodSt4hashIS2_ESt8equal_toIS2_ESaIS2_EELm83EE12count_unsafeERKS2_(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer19analyze_method_attrEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

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


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

; 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
declare dso_local noundef ptr @_ZNK13IRInstruction10get_methodEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z14resolve_methodP12DexMethodRef12MethodSearchPK9DexMethod(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z16opcode_to_searchPK13IRInstruction(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer14analyze_invokeEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironment(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = tail call noundef ptr @_ZNK13IRInstruction10get_methodEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %6 = tail call noundef i32 @_Z16opcode_to_searchPK13IRInstruction(ptr noundef nonnull %1)
  %7 = tail call noundef ptr @_Z14resolve_methodP12DexMethodRef12MethodSearchPK9DexMethod(ptr noundef %5, i32 noundef %6, ptr noundef null)
  %.not = icmp eq ptr %7, null
  %spec.select = select i1 %.not, ptr %5, ptr %7
  store ptr %spec.select, ptr %4, align 8, !tbaa !5
  %8 = call noundef i64 @_ZNK19ConcurrentContainerISt13unordered_mapIP9DexMethodSt6vectorISt10unique_ptrIN20constant_propagation31ImmutableAttributeAnalyzerState11InitializerESt14default_deleteIS7_EESaISA_EESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_SC_EEELm83EE12count_unsafeERSI_(ptr noundef nonnull align 8 dereferenceable(2664) %0, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %.not13 = icmp eq i64 %8, 0
  br i1 %.not13, label %12, label %9

9:                                                ; preds = %3
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer29analyze_method_initializationEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %10)
  br label %18

12:                                               ; preds = %3
  %13 = getelementptr inbounds i8, ptr %0, i64 5984
  %14 = call noundef i64 @_ZNK19ConcurrentContainerISt13unordered_setIP9DexMethodSt4hashIS2_ESt8equal_toIS2_ESaIS2_EELm83EE12count_unsafeERKS2_(ptr noundef nonnull align 8 dereferenceable(2664) %13, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %.not14 = icmp eq i64 %14, 0
  br i1 %.not14, label %18, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer19analyze_method_attrEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %16)
  br label %18

18:                                               ; preds = %12, %15, %9
  %.0 = phi i1 [ %11, %9 ], [ %17, %15 ], [ false, %12 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i1 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK19ConcurrentContainerISt13unordered_mapIP9DexMethodSt6vectorISt10unique_ptrIN20constant_propagation31ImmutableAttributeAnalyzerState11InitializerESt14default_deleteIS7_EESaISA_EESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_SC_EEELm83EE12count_unsafeERSI_(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer29analyze_method_initializationEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK19ConcurrentContainerISt13unordered_setIP9DexMethodSt4hashIS2_ESt8equal_toIS2_ESaIS2_EELm83EE12count_unsafeERKS2_(ptr noundef nonnull align 8 dereferenceable(2664), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN20constant_propagation26ImmutableAttributeAnalyzer19analyze_method_attrEPKNS_31ImmutableAttributeAnalyzerStateEPK13IRInstructionP19ConstantEnvironmentP9DexMethod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 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 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"}


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